<PAGE>
                                                                    EXHIBIT 10.4

                                 AMENDMENT NO. 1

                                       TO

                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

                  This AMENDMENT NO. 1 to SECOND AMENDED AND RESTATED CREDIT
AGREEMENT (the "Amendment"), dated as of February 20, 2004, is entered into by
and among Tesoro Petroleum Corporation (the "Company"), the financial
institutions party to the below-defined Credit Agreement (the "Lenders"), and
Bank One, NA (Main Office Chicago), as Administrative Agent (the "Agent"). Each
capitalized term used herein and not otherwise defined herein shall have the
meaning given to it in the below-defined Credit Agreement.

                                   WITNESSETH

                  WHEREAS, the Company, the Lenders, and the Agent are parties
to a Second Amended and Restated Credit Agreement dated as of June 17, 2003 (as
the same may be amended, restated, supplemented or otherwise modified from time
to time, the "Credit Agreement"); and

                  WHEREAS, the Company wishes to amend the Credit Agreement in
certain respects and the Lenders and the Agent are willing to amend the Credit
Agreement on the terms and conditions set forth herein;

                  NOW, THEREFORE, in consideration of the premises set forth
above, the terms and conditions contained herein, and other good and valuable
consideration, the receipt and sufficiency of which are hereby acknowledged, the
Company, the Agent and the Lenders hereby agree as follows:

         1.       Amendment to Credit Agreement. Effective as of the date first
above written, and subject to the satisfaction of the condition to effectiveness
set forth in Section 2 below, Section 2.19.1 of the Credit Agreement, which
Section sets forth issuance requirements for Facility LCs, is hereby amended to
delete therefrom the Facility LC sublimit amount of "$400,000,000" and to
substitute therefor the Facility LC sublimit amount of "$500,000,000."

         2.       Condition of Effectiveness. This Amendment shall become
effective and be deemed effective as of the date hereof, if, and only if, the
Agent shall have received executed copies of this Amendment from the Company and
the Lenders.

         3.       Representations and Warranties of the Company. The Company
hereby represents and warrants as follows:

                  (a) The Credit Agreement as previously executed constitutes
the legal, valid and binding obligation of the Company and is enforceable
against the Company in accordance with its terms.

<PAGE>

                  (b) Upon the effectiveness of this Amendment, the Company
hereby (i) represents that no Default or Unmatured Default exists under the
terms of the Credit Agreement, (ii) reaffirms all covenants, representations and
warranties made in the Credit Agreement, and (iii) agrees that all such
covenants, representations and warranties shall be deemed to have been remade as
of the effective date of this Amendment, provided that any such covenant,
representation, or warranty that references a specific date is reaffirmed as of
such referenced date. The execution, delivery and effectiveness of this
Amendment shall not, except as expressly provided herein, operate as a waiver of
any right, power, or remedy of the Lenders or the Agent under the Credit
Agreement or any related document, instrument or agreement.

         4.       Effect on the Credit Agreement.

                  (a) Upon the effectiveness of this Amendment, on and after the
date hereof, each reference in the Credit Agreement to "this Agreement,"
"hereunder," "hereof," "herein" or words of like import shall mean and be a
reference to the Credit Agreement, as amended and modified hereby.

                  (b) Except as specifically amended and modified above, the
Credit Agreement and all other documents, instruments and agreements executed
and/or delivered in connection therewith shall remain in full force and effect,
and are hereby ratified and confirmed.

                  (c) The execution, delivery and effectiveness of this
Amendment shall neither, except as expressly provided herein, operate as a
waiver of any right, power or remedy of the Lenders or the Agent, nor constitute
a waiver of any provision of the Credit Agreement or any other documents,
instruments and agreements executed and/or delivered in connection therewith.

         5.       Costs and Expenses. The Company agrees to pay all reasonable
costs, fees and out-of-pocket expenses (including attorneys' fees and expenses
charged to the Agent) incurred by the Agent and the Lenders in connection with
the preparation, arrangement, execution and enforcement of this Amendment.

         6.       GOVERNING LAW. THIS AMENDMENT SHALL BE GOVERNED BY AND
CONSTRUED IN ACCORDANCE WITH THE INTERNAL LAWS, AS OPPOSED TO THE CONFLICTS OF
LAW PROVISIONS, OF THE STATE OF NEW YORK; PROVIDED, HOWEVER, THAT IF A COURT,
TRIBUNAL OR OTHER JUDICIAL ENTITY WITH JURISDICTION OVER THE CREDIT AGREEMENT,
THIS AMENDMENT AND THE TRANSACTIONS EVIDENCED BY THE LOAN DOCUMENTS WERE TO
DISREGARD SUCH CHOICE OF LAW, THIS AMENDMENT SHALL BE GOVERNED BY AND CONSTRUED
IN ACCORDANCE WITH THE INTERNAL LAWS, AS OPPOSED TO THE CONFLICTS OF LAW
PROVISIONS, OF THE STATE OF ILLINOIS.

         7.       Headings. Section headings in this Amendment are included
herein for convenience of reference only and shall not constitute a part of this
Amendment for any other purpose.

         8.       Counterparts. This Amendment may be executed by one or more of
the parties to the Amendment on any number of separate counterparts and all of
said counterparts taken together shall be deemed to constitute one and the same
instrument.

                                        2

<PAGE>

         9.       No Strict Construction. The parties hereto have participated
jointly in the negotiation and drafting of this Amendment. In the event an
ambiguity or question of intent or interpretation arises, this Amendment shall
be construed as if drafted jointly by the parties hereto and no presumption or
burden of proof shall arise favoring or disfavoring any party by virtue of the
authorship of any provisions of this Amendment.

               The remainder of this page is intentionally blank.

                                        3

<PAGE>

                  IN WITNESS WHEREOF, this Amendment has been duly executed as
of the day and year first above written.

                                    TESORO PETROLEUM CORPORATION

                                    By: /s/ G. Scott Spendlove
                                       -----------------------------------------
                                    Name: G. Scott Spendlove
                                    Title: Vice President, Finance and Treasurer

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT


<PAGE>

                                             BANK ONE, NA (MAIN OFFICE CHICAGO),
                                             individually, as initial LC Issuer,
                                             and as Administrative Agent

                                             By: /s/ Andrew D. Hall
                                                 ----------------------
                                             Name: Andrew D. Hall
                                             Title: Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                             BANK OF AMERICA, N.A.

                                             By: /s/ Todd Eggertsen
                                                 --------------------------
                                             Name: Todd Eggertsen
                                             Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            FLEET CAPITAL CORPORATION

                                            By: /s/ Dennis M. Hansen
                                                ----------------------------
                                            Name: Dennis M. Hansen
                                            Title: Senior Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                           STATE OF CALIFORNIA PUBLIC EMPLOYEES'
                                           RETIREMENT SYSTEM

                                           By: /s/ Curtis D. Ishii
                                              ----------------------------------
                                           Name: Curtis D. Ishii
                                           Title: Senior Investment Officer

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            FORTIS CAPITAL CORP.

                                            By: /s/ Darrell W. Holley
                                                -----------------------------
                                            Name: Darrell W. Holley
                                            Title: Managing Director

                                            By: /s/ Deirdre Sanborn
                                                -----------------------------
                                            Name: Deirdre Sanborn
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            PNC BANK, NATIONAL ASSOCIATION

                                            By: /s/ Vickie Leon
                                                -----------------------------
                                            Name: Vickie Leon
                                            Title: Relationship Manager

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            WELLS FARGO FOOTHILL, LLC

                                            By: /s/ Claudia Hughes
                                                -------------------------
                                            Name: Claudia Hughes
                                            Title: Assistant Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            SIEMENS FINANCIAL SERVICES, INC.

                                            By: /s/ Frank Amodio
                                            --------------------
                                            Name: Frank Amodio
                                            Title: Vice President-Credit

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            PB CAPITAL CORPORATION

                                            By: /s/ Tyler J. McCarthy
                                                -----------------------------
                                            Name: Tyler J. McCarthy
                                            Title: Vice President

                                            By: /s/ Andrew Shipman
                                                -----------------------------
                                            Name: Andrew Shipman
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            GUARANTY BANK

                                            By: /s/ Jim R. Hamilton
                                                ----------------------------
                                            Name: Jim R. Hamilton
                                            Title: Senior Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            U.S. BANK, NATIONAL ASSOCIATION

                                            By: /s/ Thomas Visconti
                                                -----------------------------
                                            Name: Thomas Visconti
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            HIBERNIA NATIONAL BANK

                                            By: /s/ Nancy G. Moragas
                                                -----------------------------
                                            Name: Nancy G. Moragas
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            THE FROST NATIONAL BANK

                                            By: /s/ Jim Crosby
                                                -----------------------------
                                            Name: Jim Crosby
                                            Title: Senior Lender

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                       NATEXIS BANQUES POPULAIRES

                                       By: /s/ Daniel Payer
                                           -----------------------------
                                       Name: Daniel Payer
                                       Title: Vice President

                                       By: /s/ Louis P. Laville, III
                                           -----------------------------
                                       Name: Louis P. Laville, III
                                       Title: Vice President and Group Manager

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            LASALLE BUSINESS CREDIT, LLC

                                            By: /s/ Richard Pierce
                                                -----------------------------
                                            Name: Richard Pierce
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            ALASKA PACIFIC BANK

                                            By: /s/ John E. Robertson
                                                -----------------------------
                                            Name: John E. Robertson
                                            Title: Senior Vice President and
                                                   Chief Lending Officer

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            C-SQUARED CDO LTD

                                            By: TCW Advisors, Inc.,
                                                as its Portfolio Manager

                                            By: /s/ Jonathan R. Insull
                                                -----------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            CREDIT LYONNAIS NEW YORK BRANCH

                                            By: /s/ Olivier Audemard
                                                -----------------------------
                                            Name: Olivier Audemard
                                            Title: Senior Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>
                                            KZH CRESCENT 2 LLC

                                            By: /s/ Dorian Herrera
                                                -----------------------------
                                            Name: Dorian Herrera
                                            Title: Authorized Agent


        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>
                                            KZH CRESCENT 3 LLC

                                            By: /s/ Dorian Herrera
                                                -----------------------------
                                            Name: Dorian Herrera
                                            Title: Authorized Agent


        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            CELERITY CLO LIMITED

                                            By: TCW Advisors, Inc.,
                                                As Agent

                                            By: /s/ G. Steven Kalin
                                               ---------------------------------
                                            Name: G. Steven Kalin
                                            Title: Senior Vice President


                                            By: /s/ Jonathan R. Insull
                                               ---------------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director


        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            LOAN FUNDING I LLC,
                                            a wholly owned subsidiary
                                            of Citibank, N.A.

                                            By: TCW Advisors, Inc.,
                                                as portfolio manager of
                                                Loan Funding I LLC

                                            By: /s/ G. Steven Kalin
                                                -----------------------------
                                            Name: G. Steven Kalin
                                            Title: Senior Vice President

                                            By: /s/ Jonathan R. Insull
                                                -----------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            MUIRFIELD TRADING LLC

                                            By: /s/ Diana M. Himes
                                                -----------------------------
                                            Name: Diana M. Himes
                                            Title: Assistant Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            OLYMPIC FUNDING TRUST, SERIES 1999-1

                                            By: /s/ Diana M. Himes
                                                -----------------------------
                                            Name: Diana M. Himes
                                            Title: Authorized Agent

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            SEQUILS I, LTD.

                                            By: TCW Advisors, Inc.
                                                as its Collateral Manager

                                            By: /s/ G. Steven Kalin
                                                -----------------------------
                                            Name: G. Steven Kalin
                                            Title: Senior Vice President

                                            By: /s/ Jonathan R. Insull
                                                -----------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            SEQUILS IV, LTD.

                                            By: TCW Advisors, Inc. as its
                                                Collateral Manager

                                            By: /s/ G. Steven Kalin
                                                -----------------------------
                                            Name: G. Steven Kalin
                                            Title: Senior Vice President

                                            By: /s/ Jonathan R. Insull
                                                -----------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT


<PAGE>

                                            TCW SELECT LOAN FUND, LIMITED

                                            By: TCW Advisors, Inc. as its
                                                Collateral Manager

                                            By: /s/ G. Steven Kalin
                                                -----------------------------
                                            Name: G. Steven Kalin
                                            Title: Senior Vice President

                                            By: /s/ Jonathan R. Insull
                                                -----------------------------
                                            Name: Jonathan R. Insull
                                            Title: Managing Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            UBS AG, STAMFORD BRANCH

                                            By: /s/ Wilfred V. Saint
                                            ------------------------
                                            Name: Wilfred V. Saint
                                            Title: Associate Director Banking
                                                   Products Services, US

                                            By: /s/ Juan Zuniga
                                            -------------------
                                            Name: Juan Zuniga
                                            Title: Associate Director Banking
                                                   Products Services, US

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            VAN KAMPEN CLO I LTD.

                                            By: /s/ Frank Sherrod
                                                -----------------------------
                                            Name: Frank Sherrod
                                            Title: Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            VAN KAMPEN SENIOR INCOME TRUST

                                            By: /s/ Brad Langs
                                                -----------------------------
                                            Name: Brad Langs
                                            Title: Executive Director

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            Sankaty Advisors, LLC as Collateral
                                            Manager for AVERY POINT CLO, LTD.
                                            as Term Lender

                                            By: /s/ Timothy Barns
                                                -----------------------------
                                            Name: Timothy Barns
                                            Title: Senior Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            SANKATY HIGH YIELD PARTNERS II, L.P.

                                            By: /s/ Timothy Barns
                                                -----------------------------
                                            Name: Timothy Barns
                                            Title: Senior Vice President

        SIGNATURE PAGE TO AMENDMENT NO. 1 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT