<PAGE>
                                                                    EXHIBIT 10.5

                                 AMENDMENT NO. 2

                                       TO

                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

                  This AMENDMENT NO. 2 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 6.1.11 of the Credit Agreement, which
Section sets forth certain reporting requirements, is amended in its entirety as
follows:

                  6.1.11   For so long as Excess Availability is:

                  (x)  less than or equal to 25% of the Borrowing Base then in
                  effect, as soon as practicable, and in any event within three
                  Business Days after the end of each calendar week during such
                  period; and

                  (y) greater than 25% but less than or equal to 35% of the
                  Borrowing Base then in effect, as soon as practicable, and in
                  any event within 3 Business Days after the end of each of the
                  second and fourth full calendar weeks of any calendar month
                  during such period;

<PAGE>

                  the Borrower shall provide to the Agent an Interim Collateral
                  Report for the applicable one-week or two-week period
                  certified as being true and correct by an Authorized Officer
                  of the Borrower. Each Interim Collateral Report shall
                  identify, for the applicable reporting period, the aggregate
                  amount of all contra-accounts related to Specified Customers
                  net of the aggregate of the face amounts of all letters of
                  credit issued on behalf of the Borrower or the applicable
                  Subsidiary Guarantor to Specified Customers as payment for
                  goods or services purchased by the Borrower or the applicable
                  Subsidiary Guarantor from the Specified Customers.

                  No Interim Collateral Report described in this Section 6.1.11
                  shall be required to be delivered by the Borrower during any
                  period Excess Availability exceeds 35% of the Borrowing Base
                  then in effect.

         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 Required 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.

                  (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.

                                        2

<PAGE>

                  (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.

         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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            KZH CRESCENT 2 LLC

                                            By: /s/ Susan Lee
                                                -----------------------------
                                            Name: Susan Lee
                                            Title: Authorized Agent

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

<PAGE>

                                            KZH CRESCENT 3 LLC

                                            By: /s/ Susan Lee
                                                -----------------------------
                                            Name: Susan Lee
                                            Title: Authorized Agent

        SIGNATURE PAGE TO AMENDMENT NO. 2 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. 2 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. 2 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. 2 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT

<PAGE>

                                            OLYMPIC FUNDING TRUST, SERIES 1991-1

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

        SIGNATURE PAGE TO AMENDMENT NO. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 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. 2 TO TESORO PETROLEUM CORPORATION
                  SECOND AMENDED AND RESTATED CREDIT AGREEMENT