<PAGE>
                                                 ---------------------------
                                                          OMB APPROVAL
                                                 ----------------------------
                                                 OMB Number:       3235-0145
                                                 Expires:  December 31, 1997
                                                 Estimated average burden
                                                 hours per response....14.90
                                                 ----------------------------



                              UNITED STATES
                    SECURITIES AND EXCHANGE COMMISSION
                          Washington, D.C. 20549

                                SCHEDULE 13G

                 Under the Securities Exchange Act of 1934
                          (Amendment No.       )*
                                         ------

                                 UAL Corp.
--------------------------------------------------------------------------------
                              (Name of Issuer)

                                   Common
--------------------------------------------------------------------------------
                       (Title of Class of Securities)

                                902549500
                     ----------------------------------
                              (CUSIP Number)


Check the following box if a fee is being paid with this statement / /. (A 
fee is not required only if the filing person: (1) has a previous statement 
on filing reporting beneficial ownership of more than five percent of the 
class of securities described in Item 1; and (2) has filed no amendment 
subsequent thereto reporting beneficial ownership of five percent or less of 
such class.) (See Rule 13d-7).

   *The remainder of this cover page shall be filled out for a reporting 
person's initial filing on this form with respect to the subject class of 
securities, and for any subsequent amendment containing information which 
would alter the disclosures provided in a prior cover page.

   The information required in the remainder of this cover page shall not 
be deemed to be "filed" for the purpose of Section 18 of the Securities 
Exchange Act of 1934 ("Act") or otherwise subject to the liabilities of that 
section of the Act but shall be subject to all other provisions of the Act 
(however, see the Notes).


                             Page 1 of 3 pages

<PAGE>

CUSIP No. 902549500                 13G                 Page 2 of 3 Pages
          ---------                                     -----------------

-------------------------------------------------------------------------------
 (1) Names of Reporting Persons.
     S.S. I.R.S. Identification No. of above person

          PRIMECAP Management Company                  95-3868081
-------------------------------------------------------------------------------
 (2) Check the Appropriate Box if a Member of a Group (See Instructions) 
                                                                (a) / / (b) / /
-------------------------------------------------------------------------------
 (3) SEC Use Only

-------------------------------------------------------------------------------
 (4) Citizenship or Place of Organization
          225 South Lake Avenue #400, Pasadena, CA 91101
-------------------------------------------------------------------------------
 Number of Shares             (5) Sole Voting Power
 Beneficially                       124,295
 Owned by                    --------------------------------------------------
 Each Reporting               (6) Shared Voting Power
 Person With:                       -0-
                             --------------------------------------------------
                              (7) Sole Dispositive Power
                                    3,424,295
                             --------------------------------------------------
                              (8) Shared Dispositive Power
                                    -0-
-------------------------------------------------------------------------------
 (9) Aggregate Amount Beneficially Owned by Each Reporting Person
          3,424,295
-------------------------------------------------------------------------------
(10) Check if the Aggregate Amount in Row (9) Excludes Certain Shares (See
     Instructions)                                              / /
-------------------------------------------------------------------------------
(11) Percent of Class Represented by Amount in Row (9)
          6.40%
-------------------------------------------------------------------------------
(12) Type of Reporting Person (See Instructions)
          IA
-------------------------------------------------------------------------------
                     SEE INSTRUCTION BEFORE FILLING OUT!


                             Page 2 of 3 pages

<PAGE>

CUSIP No. 902549500                 13G                 Page 3 of 3 Pages
          ---------                                     -----------------


    (c) Number of shares as to which the person has:

          (i) Sole power to vote or to direct the vote
         (ii) Shared power to vote or to direct the vote
        (iii) Sole power to dispose or to direct the disposition of
         (iv) Shared power to dispose or to direct the disposition of

INSTRUCTION: For computations regarding securities which represent a right to 
acquire an underlying security see Rule 13d-3(d)(1).

ITEM 5.  OWNERSHIP OF FIVE PERCENT OR LESS OF A CLASS

    If this statement is being filed to report the fact that as of the date
hereof the reporting person has ceased to be the beneficial owner of more than
five percent of the class of securities, check the following.  / /

INSTRUCTION: Dissolution of a group requires a response to this item.

ITEM 6.  OWNERSHIP OF MORE THAN FIVE PERCENT ON BEHALF OF ANOTHER PERSON

    If any other person is known to have the right to receive or the power to 
direct the receipt of dividends from, or the proceeds from the sale of, such 
securities, a statement to the effect should be included in response to this 
item and, if such interest relates to more than five percent of the class, 
such person should be identified. A listing of the shareholders of an 
investment company registered under the Investment Company Act of 1940 or the 
beneficiaries of employee benefit plan, pension fund or endowment fund is not 
required.

ITEM 7.  IDENTIFICATION AND CLASSIFICATION OF THE SUBSIDIARY WHICH ACQUIRED
         THE SECURITY BEING REPORTED ON BY THE PARENT HOLDING COMPANY

     If a parent holding company has filed this schedule, pursuant to Rule 
13d-1(b)(ii)(G), so indicate under Item 3(g) and attach an exhibit stating 
the identity and Item 3 classification of the relevant subsidiary. If a 
parent holding company has filed this schedule pursuant to Rule 13d-1(c), 
attach an exhibit stating the identification of the relevant subsidiary.

ITEM 8.  IDENTIFICATION AND CLASSIFICATION OF MEMBERS OF THE GROUP

    If a group has filed this schedule pursuant to Rule 13d-1(b)(ii)(H), so 
indicate under Item 3(h) and attach an exhibit stating the identity and Item 
3 classification of each member of the group. If a group has filed this 
schedule pursuant to Rule 13d-1(c), attach an exhibit stating the identity of 
each member of the group.

ITEM 9.  NOTICE OF DISSOLUTION OF GROUP

    Notice of dissolution of a group may be furnished as an exhibit stating 
the date of the dissolution and that all further filings with respect to 
transactions in the security reported on will be filed, if required, by 
members of the group, in their individual capacity. See item 5.

ITEM 10. CERTIFICATION

    The following certification shall be included if the statement is filed
pursuant to section 240.13d-1(b):
    By signing below I certify that, to the best of my knowledge and belief, 
the securities referred to above were not acquired and are not held for the 
purpose of or with the effect of changing or influencing the control of the 
issuer of the securities and were not acquired and are not held in connection 
with or as a participant in any transaction having that purpose or effect.

                                  SIGNATURE

    After reasonable inquiry and to the best of my knowledge and belief, I
certify that the information set forth in this statement is true, complete and
correct.

                                                 January 31, 2000
                                       ----------------------------------------
                                                         Date

                                               /s/ Theo Kolokotrones
                                       ----------------------------------------
                                                      Signature

                                              Theo A. Kolokotrones, President
                                       ----------------------------------------
                                                      Name/Title

                             Page 3 of 3 pages