Exhibit 10.5

AMENDMENT NO. 2 TO $550,000,000

SECOND AMENDED AND RESTATED CREDIT AGREEMENT

This AMENDMENT NO. 2 TO $550,000,000 SECOND AMENDED AND RESTATED CREDIT
AGREEMENT (this “Amendment”), dated as of September 17, 2010, among Magellan
Midstream Partners, L.P., as Borrower, the Lenders party hereto and Wells Fargo
Bank, NA, successor-in-interest to Wachovia Bank, N.A., as Administrative Agent
and Issuing Bank. Unless otherwise indicated, all capitalized terms used herein
and not otherwise defined herein shall have the respective meanings provided
such terms in the $550,000,000 Second Amended and Restated Credit Agreement
among the parties hereto dated as of September 20, 2007, as amended by that
certain Amendment No. 1 to $550,000,000 Second Amended and Restated Credit
Agreement among the parties hereto, dated as of December 4, 2009 (as amended,
the “Credit Agreement”).

W I T N E S S E T H :

WHEREAS, subject to the terms and conditions of this Amendment, the parties
hereto wish to amend certain provisions of the Credit Agreement as herein
provided;

NOW, THEREFORE, it is agreed:

 

I. Amendment.

In Section 1.01, Defined Terms, the definition of “Consolidated EBITDA” shall be
amended and restated in its entirety as follows:

“Consolidated EBITDA” means, with respect to the Borrower and its Restricted
Subsidiaries for any period, Consolidated Net Income for such period plus,
without duplication and to the extent reflected as a charge in the statement of
such Consolidated Net Income for such period, the sum of (a) income tax expense,
(b) interest expense, amortization or write-off of debt discount and debt
issuance costs and commissions, discounts and other fees and charges associated
with Indebtedness (including the Indebtedness hereunder), (c) depreciation and
amortization expense, (d) amortization of intangibles and organization costs,
(e) any extraordinary non-cash expenses or losses, including, in any event,
non-cash asset write-downs, and any unrealized losses or negative adjustments
under Accounting Standards Codification (“ASC”) 815 Derivatives and Hedging (and
any ASC or other standards or statements replacing, modifying or superseding
such ASC) as the result of changes in the fair market value of Swap Agreements),
and (f) any extraordinary, unusual or non-recurring cash income or gains to the
extent not included in Consolidated Net Income, and minus, (i) to the extent
included in the statement of such Consolidated Net Income for such period, any
extraordinary, unusual or non-recurring non-cash income or gains (including,
whether or not otherwise includable as a separate item in the statement of such
Consolidated Net Income for such period, gains on the sales of assets outside of
the ordinary course of business), and any unrealized gains or positive
adjustments

--------------------------------------------------------------------------------

under ASC 815 Derivatives and Hedging (and any ASC or other standards or
statements replacing, modifying or superseding such ASC) as the result of
changes in the fair market value of Swap Agreements and (ii) any cash payments
made during such period in respect of items described in clause (e) above
subsequent to the fiscal quarter in which the relevant non-cash expenses or
losses were reflected as a charge in the statement of Consolidated Net Income,
all as determined on a consolidated basis. For purposes of calculating
Consolidated EBITDA for any period, adjustments shall be made to income and
expenses as set forth on Annex 1 hereto. Additionally, for purposes of
calculating Consolidated EBITDA for any period, if during such period the
Borrower or any Restricted Subsidiary acquires any assets with an acquisition
cost of $20,000,000 or more or any Person (or any material interest in any
Person), the Consolidated EBITDA attributable to such assets or an amount equal
to the percentage of ownership of the Borrower or a Restricted Subsidiary, as
the case may be, in such Person times the Consolidated EBITDA of such Person,
for such period determined on a pro forma basis may be included as Consolidated
EBITDA for such period as if such acquisition occurred on the first day of such
period; provided, that during the portion of such period that follows such
acquisition, the computation in respect of the Consolidated EBITDA of such
Person or such assets, as the case may be, shall be made on the basis of actual
(rather than pro forma) results. Such pro forma calculations shall be determined
(1) in good faith by a Financial Officer, and (2) without giving effect to any
anticipated or proposed change in operations, revenues, expenses or other items
included in the computation of Consolidated EBITDA unless otherwise approved by
the Administrative Agent, such approval not to be unreasonably withheld. In
connection with any Material Project, Consolidated EBITDA, as used in
determining the Leverage Ratio, shall be modified so as to include Material
Project EBITDA Adjustments.

 

II. Miscellaneous Provisions.

A. The Credit Agreement is modified only by the express provisions of this
Amendment and this Amendment shall not constitute a modification, acceptance or
waiver of any other provision of the Credit Agreement except as specifically set
forth herein.

B. This Amendment may be executed in any number of counterparts and by the
different parties hereto on separate counterparts, each of which counterparts
when executed and delivered shall be an original, but all of which shall
together constitute one and the same instrument.

C. This Amendment shall be construed in accordance with and governed by the law
of the State of New York.

D. This Amendment shall become effective as of the date first written above (the
“Amendment Effective Date”) when this Amendment is executed and delivered by the
Borrower and Lenders constituting the Required Lenders; provided, however, that
as of the date hereof, (i) the representations and warranties of the Borrower
set forth in the Credit Agreement shall be true and correct in all material
respects, before and after giving effect to this Amendment, except

--------------------------------------------------------------------------------

to the extent any such representation or warranty is stated to relate to an
earlier date in which case such representation and warranty will be true and
correct on as of such earlier date, provided that the aforementioned materiality
qualifier shall not apply to any representation or warranty that contain a
materiality qualifier within such representation and warranty, and (ii) before
and after giving effect to this Amendment, no Default or Event of Default shall
have occurred and be continuing.

E. From and after the Amendment Effective Date, all references in the Credit
Agreement shall be deemed to be references to the Credit Agreement, as amended
and modified hereby.

[END OF TEXT]

--------------------------------------------------------------------------------

 

IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed
by their proper officers on the date and year first above written.

 

MAGELLAN MIDSTREAM PARTNERS, L.P. By:   Magellan GP, LLC, its general partner
By:   /s/ John D. Chandler Name:   John D. Chandler Title:   Senior Vice
President and Chief Financial Officer

--------------------------------------------------------------------------------

 

WELLS FARGO BANK, NA,

individually and as Administrative Agent and as

Issuing Bank

By:   /s/ Paul Farrell Name:   Paul Farrell Title:   Director

--------------------------------------------------------------------------------

 

SUNTRUST BANK

By:

  /s/ Carmen Malizia

Name:

  Carmen Malizia

Title:

  Vice President

--------------------------------------------------------------------------------

 

THE BANK OF TOKYO-MITSUBISHI UFJ, LTD. By:   /s/ Linda Terry Name:   Linda Terry
Title:   Authorized Signatory

--------------------------------------------------------------------------------

 

CITIBANK, N.A. By:   /s/ John Miller Name:   John Miller Title:   Vice President

--------------------------------------------------------------------------------

 

JPMORGAN CHASE BANK, a New York banking corporation By:   /s/ Preeti Bhatnagar
Name:   Preeti Bhatnagar Title:   Associate

--------------------------------------------------------------------------------

 

UBS AG, STAMFORD BRANCH By:   /s/ Irja R. Otsa Name:   Irja R. Otsa Title:  
Associate Director By:   /s/ Mary E. Evans Name:   Mary E. Evans Title:  
Associate Director

--------------------------------------------------------------------------------

 

BANK OF AMERICA, N.A. By:  

 

Name:   Title:  

--------------------------------------------------------------------------------

 

DEUTSCHE BANK AG NEW YORK BRANCH By:   /s/ Philippe Sandmeier Name:   Philippe
Sandmeier Title:   Managing Director By:   /s/ Ming K. Chu Name:   Ming K. Chu
Title:   Vice President

--------------------------------------------------------------------------------

 

CREDIT SUISSE AG, CAYMAN ISLANDS

BRANCH (FORMERLY KNOWN AS CREDIT

SUISSE, CAYMAN ISLANDS BRANCH)

By:   /s/ Mikhail Faybusovich Name:   Mikhail Faybusovich Title:   Vice
President By:   /s/ Vipul Dhadda Name:   Vipul Dhadda Title:   Associate

--------------------------------------------------------------------------------

 

BANK OF AMERICA, N.A.,

SUCCESSOR BY MERGER TO

MERRILL LYNCH BANK USA

By:  

 

Name:   Title:  

--------------------------------------------------------------------------------

 

MORGAN STANLEY BANK By:   /s/ Sherrese Clarke Name:   Sherrese Clarke Title:  
Authorized Signatory

--------------------------------------------------------------------------------

 

ROYAL BANK OF CANADA By:   /s/ James R. Alfred Name:   James R. Alfred Title:  
Authorized Signatory

--------------------------------------------------------------------------------

 

CHANG HWA COMMERCIAL BANK, LTD. By:  

 

Name:   Title:  

--------------------------------------------------------------------------------

 

SUMITOMO MITSUI BANKING

CORPORATION, as a Lender

By:   /s/ Masakazu Hasegawa Name:   Masakazu Hasegawa Title:   General Manager