<PAGE>

                                                                    EXHIBIT 10.8

                                                                  EXECUTION COPY

                        PIPELINES AND TERMINALS AGREEMENT

      This Pipelines and Terminals Agreement (this "Agreement") is dated as of
July 13, 2004, by and among Holly Corporation, a Delaware corporation ("Holly"),
Navajo Refining Company, L.P., a Delaware limited partnership ("Navajo
Refining"), Holly Refining and Marketing Company, a Delaware corporation,
("Holly Refining" and, together with Holly and Navajo Refining, the "Holly
Entities"), Holly Energy Partners, L.P., a Delaware limited partnership (the
"Partnership"), HEP Operating Company, L.P., a Delaware limited partnership (the
"Operating Partnership"), HEP Logistics Holdings, L.P., a Delaware limited
partnership (the "General Partner"), Holly Logistic Services, L.L.C., a Delaware
limited liability company ("Holly GP"), and HEP Logistics GP, L.L.C., a Delaware
limited liability company ("OLP GP" and, together with the Partnership, the
Operating Partnership, the General Partner and Holly GP, the "Partnership
Entities").

                                    RECITALS:

      WHEREAS, as of the date hereof, by virtue of its indirect ownership
interests in the Partnership, the Holly Entities have an economic interest in
the financial and commercial success of the Partnership;

      WHEREAS, the Partnership Group (as defined below) is substantially
dependent upon the Holly Entities for the volumes of Refined Products (as
defined below) transported through the Partnership Group's pipelines and handled
at the Partnership Group's terminals such that a significant reduction in the
Holly Entities' use of the Partnership Group's services to transport and handle
the Refined Products would result in a correspondingly significant reduction in
the financial and commercial success of the Partnership Group; and

      WHEREAS, the Holly Entities and the Partnership Entities desire to enter
into this Agreement.

      NOW, THEREFORE, in consideration of the covenants and obligations
contained herein, the parties to this Agreement hereby agree as follows:

      SECTION 1. DEFINITIONS

      Capitalized terms used throughout this Agreement and not otherwise defined
herein shall have the meanings set forth below.

      "Affiliate" means, with respect to any Person, any other Person that
directly or indirectly through one or more intermediaries controls, is
controlled by or is under common control with, the Person in question,
excluding, in the case of Holly, the Partnership Group Members.

      "Applicable Law" means any applicable statute, law, regulation, ordinance,
rule, judgment, rule of law, order, decree, permit, approval, concession, grant,
franchise, license, agreement, requirement, or other governmental restriction or
any similar form of decision of, or any provision or condition of any permit,
license or other operating authorization issued under any of the foregoing by,
or any determination by any Governmental Authority having or asserting
jurisdiction over the matter or matters in question, whether now or hereafter in
effect

<PAGE>

and in each case as amended (including, without limitation, all of the terms and
provisions of the common law of such Governmental Authority), as interpreted and
enforced at the time in question.

      "Arbitrable Dispute" means any and all disputes, Claims, controversies and
other matters in question between any of the Partnership Entities, on the one
hand, and any of the Holly Entities, on the other hand, arising out of or
relating to this Agreement or the alleged breach hereof, or in any way relating
to the subject matter of this Agreement regardless of whether (a) allegedly
extra-contractual in nature, (b) sounding in contract, tort or otherwise, (c)
provided for by Applicable Law or otherwise or (d) seeking damages or any other
relief, whether at law, in equity or otherwise.

      "bpd" means barrels per day.

      "Claim" means any existing or threatened future claim, demand, suit,
action, investigation, proceeding, governmental action or cause of action of any
kind or character (in each case, whether civil, criminal, investigative or
administrative), known or unknown, under any theory, including those based on
theories of contract, tort, statutory liability, strict liability, employer
liability, premises liability, products liability, breach of warranty or
malpractice.

      "Claimant" has the meaning set forth in Section 10(f).

      "Closing Date" means the date of the closing of the Partnership's initial
public offering of Common Units.

      "Common Units" has the meaning set forth in the Partnership Agreement.

      "Contract Quarter" means a three-month period that commences on July 1,
October 1, January 1, or April 1, and ends on September 30, December 31, March
31 or June 30, respectively.

      "Contract Year" means a year that commences on July 1 and ends on the last
day of June, except that the initial Contract Year shall commence on July 13,
2004.

      "Control" (including with correlative meaning, the term "controlled by")
means, as used with respect to any Person, the possession, direct or indirect,
of the power to direct or cause the direction of the management and policies of
such Person, whether through the ownership of voting securities, by contract or
otherwise.

      "Controlled Affiliates" means with respect to any Person, any other Person
that directly or indirectly through one or more intermediaries is controlled by
such Person, excluding, in the case of Holly, the Partnership Group Members.

      "Deficiency Notice" has the meaning set forth in Section 9(a).

      "Deficiency Payment" has the meaning set forth in Section 9(a).

      "EBITDA" means earnings before interest, taxes, depreciation and
amortization.

                                       2

<PAGE>

      "FERC" means the United States Federal Energy Regulatory Commission.

      "Force Majeure" means acts of God, strikes, lockouts or other industrial
disturbances, acts of the public enemy, wars, blockades, insurrections, riots,
storms, floods, washouts, arrests, the order of any court or Governmental
Authority having jurisdiction while the same is in force and effect, civil
disturbances, explosions, breakage, accident to machinery, storage tanks or
lines of pipe, inability to obtain or unavoidable delay in obtaining material or
equipment, and any other causes whether of the kind herein enumerated or
otherwise not reasonably within the control of the party claiming suspension and
which by the exercise of due diligence such party is unable to prevent or
overcome.

      "Governmental Authority" means any federal, state, local or foreign
government or any provincial, departmental or other political subdivision
thereof, or any entity, body or authority exercising executive, legislative,
judicial, regulatory, administrative or other governmental functions or any
court, department, commission, board, bureau, agency, instrumentality or
administrative body of any of the foregoing.

      "Holly Group" means Holly, Navajo Refining and Holly Refining and any
Subsidiary of Navajo Refining or Holly Refining, treated as a single
consolidated entity.

      "Holly Group Member" means any member of the Holly Group.

      "Limited Partner" has the meaning set forth in the Partnership Agreement.

      "Minimum Revenue Commitment" has the meaning set forth in Section 2(a).

      "Navajo Refinery" means the refining facilities owned by the Holly Group
in Artesia and Lovington, New Mexico.

      "Omnibus Agreement" means the Omnibus Agreement, dated as of the Closing
Date, among Holly, the Partnership, the Operating Partnership, the General
Partner, Holly GP, OLP GP and Navajo Pipeline Co., L.P.

      "PPI" has the meaning set forth in Section 2(a).

      "Partnership Agreement" means the First Amended and Restated Agreement of
Limited Partnership of Holly Energy Partners, L.P., dated as of the Closing
Date, as such agreement is in effect on the Closing Date, to which reference is
hereby made for all purposes of this Agreement. No amendment or modification to
the Partnership Agreement subsequent to the Closing Date shall be given effect
for the purposes of this Agreement unless consented to by each of the parties to
this Agreement.

      "Partnership Group" means the Partnership, the Operating Partnership and
any Subsidiary of any such Person, treated as a single consolidated entity.

      "Partnership Group Member" means any member of the Partnership Group.

                                       3

<PAGE>

      "Person" means an individual or a corporation, limited liability company,
partnership, joint venture, trust, unincorporated organization, association,
government agency or political subdivision thereof or other entity.

      "Prime Rate" means the prime rate per annum announced by Union Bank of
California, N.A., or if Union Bank of California, N.A. no longer announces a
prime rate for any reason, the prime rate per annum announced by the largest
U.S. bank measured by deposits from time to time as its base rate on corporate
loans, automatically fluctuating upward or downward with each announcement of
such prime rate.

      "Refined Products" means gasolines, diesel fuel, jet fuel, kerosene,
heating oil, distillates, transmix, liquefied petroleum gas, natural gas liquids
and blend stocks.

      "Refined Product Pipelines" means the pipelines described on Exhibit A
attached hereto.

      "Refined Product Terminals" means the terminals described on Exhibit B
attached hereto.

      "Refineries" means, collectively, the Navajo Refinery and the Woods Cross
Refinery.

      "Refund" has the meaning set forth in Section 9(c).

      "Respondent" has the meaning set forth in Section 10(f).

      "Subsidiary" means with respect to any Person, (a) a corporation of which
more than 50% of the voting power of shares entitled (without regard to the
occurrence of any contingency) to vote in the election of directors or other
governing body of such corporation is owned, directly or indirectly, at the date
of determination, by such Person, by one or more Subsidiaries of such Person or
a combination thereof, (b) a partnership (whether general or limited) in which
such Person or a Subsidiary of such Person is, at the date of determination, a
general or limited partner of such partnership, but only if more than 50% of the
partnership interests of such partnership (considering all of the partnership
interests of the partnership as a single class) is owned, directly or
indirectly, at the date of determination, by such Person, by one or more
Subsidiaries of such Person, or a combination thereof, or (c) any other Person
(other than a corporation or a partnership) in which such Person, one or more
Subsidiaries of such Person, or a combination thereof, directly or indirectly,
at the date of determination, has (i) at least a majority ownership interest or
(ii) the power to elect or direct the election of a majority of the directors or
other governing body of such Person.

      "Woods Cross Refinery" means the refinery owned by the Holly Group in
Woods Cross, Utah.

      SECTION 2. AGREEMENT TO USE SERVICES RELATING TO PIPELINES AND TERMINALS.

      This Agreement sets forth a commercial arrangement consistent with
historical operational practices between the Holly Group and the predecessor to
the Partnership as well as the objectives of the parties. The parties intend to
be strictly bound by the commercial terms set forth in this Agreement, which set
forth the Minimum Revenue Commitment on the part of the Holly Group and require
the Partnership Group to provide certain transportation and terminalling

                                       4

<PAGE>

services to the Holly Group. The principal objective of the Partnership Group is
for the Holly Group to meet or exceed the Minimum Revenue Commitment. The
principal objective of the Holly Group is for the Partnership Group to provide
services to the Holly Group in a manner that enables the Holly Group to operate
its assets in a manner at least as favorably as the historical course of dealing
between the parties when the Holly Group was the principal user of the Refined
Product Pipelines and the Refined Product Terminals.

      (a) Minimum Revenue Commitment. During the term of this Agreement and
subject to the terms and conditions of this Agreement, the Holly Group agrees as
follows:

            (i) Subject to Section 3, for a term of 15 Contract Years commencing
      on July 13, 2004, the Holly Group will transport on the Refined Product
      Pipelines and terminal in the Refined Product Terminals an amount of
      Refined Products in the aggregate that will produce revenue to the
      Partnership Group in an amount at least equal to $8.85 million per
      Contract Quarter (the "Minimum Revenue Commitment").

            (ii) The Minimum Revenue Commitment shall be adjusted on July 1 of
      each Contract Year by an amount equal to the percentage increase, if any,
      between the two preceding calendar years, in the Producer Price Index for
      Finished Goods, seasonally adjusted, as published by the Department of
      Labor ("PPI"); provided, however, that the Minimum Revenue Commitment will
      not decrease as a result of any decrease in the PPI. If that index is no
      longer published, the Holly Group and the Partnership Group shall
      negotiate in good faith to agree on a new index that gives comparable
      protection against inflation and the same method of adjustment for
      increases in the new index shall be used to calculate increases in the
      Minimum Revenue Commitment. If the Holly Group and the Partnership Group
      are unable to agree, a new index will be determined by binding arbitration
      in accordance with Section 10(f) of this Agreement and the same method of
      adjustment for increases in the new index shall be used to calculate
      increases in the Minimum Revenue Commitment.

            (iii) If the Holly Group is unable for a period of time to transport
      on the Refined Product Pipelines or terminal in the Refined Product
      Terminals the volumes of Refined Products required to meet the Minimum
      Revenue Commitment as a result of the Partnership Group's operational
      difficulties, prorationing or difficulties with pipeline connections, then
      upon written notice by Holly to the Partnership Group, the Minimum Revenue
      Commitment will be reduced for such period of time by an amount equal to:
      (1) the volume of Refined Products that the Holly Group is unable to
      transport on the Refined Product Pipelines or terminal in the Refined
      Product Terminals as a result of the Partnership Group's operational
      difficulties, prorationing or difficulties with pipeline connections
      multiplied by (2) the applicable tariffs and terminal service fees.

      (b) Tariffs and Terminal Service Fees. The initial service fees for
terminalling the Refined Products in the Refined Product Terminals under this
Section 2 are set forth on the fee schedule attached hereto as Exhibit C. The
rules and regulations applicable to interstate and intrastate service on the
Refined Product Pipelines shall be as set forth in the pro forma rules and
regulations tariffs attached hereto as Exhibit D and Exhibit E respectively. The
initial tariff rates for interstate and intrastate service on the Refined
Product Pipelines shall be as set forth in the

                                       5

<PAGE>

pro forma tariffs attached hereto as Exhibit F and Exhibit G respectively. The
initial tariff rates shall be adjusted on July 1 of each Contract Year by an
amount equal to the percentage change, if any, between the two immediately
preceding calendar years, in the PPI. If that index is no longer published, the
Holly Group and the Partnership Group shall negotiate in good faith to agree on
a new index that gives comparable protection against inflation or deflation and
the same method of adjustment for increases or decreases in the new index shall
be used to calculate increases or decreases in the tariff rates. If the Holly
Group and the Partnership Group are unable to agree, a new index will be
determined by binding arbitration in accordance with Section 10(f) of this
Agreement and the same method of adjustment for increases or decreases in the
new index shall be used to calculate increases or decreases in the tariff rates.
Notwithstanding that the Minimum Revenue Commitment will be determined on a
Contract Year basis, the applicable fees, tariff rates and other charges
provided for in this Agreement will become effective as of the date of this
Agreement, or in the case of the Refined Product Pipeline pipeline tariff rates,
as soon thereafter as those rates become effective. The Partnership Group will
use commercially reasonable efforts to obtain the necessary regulatory approvals
for the Refined Product Pipeline tariff rates set forth in Exhibit F and Exhibit
G to become effective on the date of this Agreement or as soon as possible
thereafter.

      (c) Obligations of the Partnership Group. During the term of this
Agreement and subject to the terms and conditions of this Agreement, including
Section 10(c), the Partnership Group agrees to own or lease, operate and
maintain the assets necessary to accept the deliveries from the Holly Group and
to provide the services required under this Agreement. Notwithstanding the
preceding sentence, subject to Section 10(c) of this Agreement and Article VI of
the Omnibus Agreement, the Partnership Group is free to sell any of its assets,
including assets that provide services under this Agreement, and the Partnership
or any Partnership Group Member is free to merge with another entity (whether or
not the Partnership or the Partnership Group Member is the surviving entity in
such merger) and is free to sell all of its assets or all of its equity to
another entity at any time. At the request of the Holly Group, and subject in
each case to any applicable common carrier proration duties, the Partnership
Group agrees to use commercially reasonable efforts to transport by pipeline for
the Holly Group each month during the term of this Agreement (i) up to 40,000
bpd of Refined Products from Artesia to El Paso on the Partnership's Artesia to
Orla to El Paso Refined Product Pipeline or its Artesia to El Paso Refined
Product Pipeline and (ii) up to 40,000 bpd of Refined Products from Artesia to
Moriarty or Artesia to Bloomfield on the Partnership's Artesia to Moriarty and
Artesia to Bloomfield Refined Product Pipeline. The Partnership Group agrees to
provide terminalling services for all Holly Group volumes of Refined Products
transported to the Refined Product Terminals. To the extent that the Holly Group
is entitled to an exception under Section 3 of this Agreement to its obligations
under Section 2(a) of this Agreement, the corresponding obligations of the
Partnership Group under this Section 2(c) will be proportionately reduced.

      (d) Ancillary Services. The Partnership Group will provide ancillary
services as have been provided historically, such as truck rack blending, tank
sampling and tank-to-tank transfers, to the Holly Group. The fees for such
ancillary services are included in the fees established under this Agreement for
services provided under Section 2(b). All fuel additives, dyes, de-icers and
other additives requested to be added to the Holly Group's Refined Products will
be provided by the Holly Group at no cost to the Partnership Group. If any
ancillary services are requested by the Holly Group that are different in kind,
scope or frequency from the ancillary

                                       6

<PAGE>

services that have been historically provided, then the parties shall negotiate
in good faith to determine the appropriate rates to be charged for such
services. The Holly Group shall be responsible for maintaining the integrity of
its operations and the quality of its products so as to not cause additional
operating costs related to ancillary services to be incurred by the Partnership
Group.

      (e) Pipeline Direction. Without Holly's prior written consent, which shall
not be unreasonably withheld, the Partnership Group will not reverse the
direction of any Refined Product Pipeline or connect any other pipeline to the
Refined Product Pipelines or Refined Product Terminals; provided, however, that
the Partnership Group may take any necessary emergency action to prevent or
remedy a release of Refined Products from a Refined Products Pipeline or Refined
Products Terminal without obtaining the consent required by this Section 2(e).

      (f) Product Losses. With respect to the Refined Product Terminals, the
Partnership Group will be responsible for all product losses, as determined on a
quarterly basis on a terminal by terminal basis, that are greater than 0.25% of
the product terminalled in accordance with this Section 2. All product losses
with respect to the Refined Product Terminals will be offset by product gains
with respect to the Refined Product Terminals, if any, as determined on a
quarterly basis on a terminal by terminal basis. Product gains at the Refined
Product Terminals, after any offsetting losses, will be the property of the
Partnership Group.

      (g) Taxes. The Holly Group will pay all taxes, import duties, license fees
and other charges by any Governmental Authority levied on the Refined Products
delivered by the Holly Group for transportation or storage by the Partnership
Group in the Refined Product Pipelines and Refined Product Terminals, including,
but not limited to, any New Mexico gross receipts taxes.

      (h) Timing of Payments. The Holly Group will make payments to the
Partnership Group on a monthly basis during the term of this Agreement with
respect to services rendered by the Partnership Group under this Agreement in
the prior month. Payments not received by the Partnership Group on or prior to
the applicable payment date will accrue interest at the Prime Rate from the
applicable payment date until paid.

      (i) Notification of Utilization. When requested by the Partnership Group,
Holly will provide to the Partnership Group written notification of the Holly
Group's reasonable good faith estimate of its anticipated future utilization of
the assets of the Partnership Group.

      (j) Scheduling of Product Movements. The Partnership Group will use its
reasonable commercial efforts to schedule Refined Product movements and accept
deliveries of Refined Products hereunder in a manner that is consistent with the
historical dealings between the parties, as such dealings may change from time
to time.

      (k) Monthly Surcharge. If new laws or regulations are enacted that require
the Partnership Group to make substantial and unanticipated capital expenditures
with respect to the Refined Products Terminals, the Partnership Group may impose
a monthly surcharge to cover the Holly Group's pro rata share of the Partnership
Group's cost of complying with these laws or

                                       7

<PAGE>

regulations. The Holly Group and the Partnership Group shall use their
reasonable commercial efforts to comply with these laws and regulations, and
shall negotiate in good faith to mitigate the impact of these laws and
regulations and to determine the level of the monthly surcharge. If the Holly
Group and the Partnership Group are unable to agree on the level of the monthly
surcharge, such surcharge will be determined by binding arbitration in
accordance with Section 10(f) of this Agreement.

      (l) Increases in Pipeline Tariff Rates. If new laws or regulations are
enacted that require the Partnership Group to make substantial and unanticipated
capital expenditures with respect to the Refined Product Pipelines, the
Partnership Group may file new tariff rates in order to recover the Partnership
Group's cost of complying with these laws or regulations (including a reasonable
return). The Holly Group and the Partnership Group shall use their reasonable
commercial efforts to comply with these laws and regulations, and shall
negotiate in good faith to mitigate the impact of these laws and regulations and
to determine the amount of the new tariff rates. If the Holly Group and the
Partnership Group are unable to agree on the amount of the new tariff rates that
the Partnership Group will file, such tariff rates will be determined by binding
arbitration in accordance with Section 10(f) of this Agreement.

      SECTION 3. EXCEPTIONS TO THE HOLLY GROUP'S OBLIGATIONS

      (a) Shut Down or Reconfiguration of Refineries. The Holly Group must
deliver to the Partnership Group at least twelve months advance written notice
of any planned shut down or reconfiguration (excluding planned maintenance
turnarounds) of any Refinery or any portion of a Refinery that would reduce such
Refinery's output. The Holly Group will use its commercially reasonable efforts
to mitigate any reduction in the Minimum Revenue Commitment that would result
from such a shut down or reconfiguration. If the Holly Group shuts down or
reconfigures any Refinery or any portion of a Refinery (excluding planned
maintenance turnarounds) and reasonably believes in good faith that such shut
down or reconfiguration will jeopardize its ability to satisfy the Minimum
Revenue Commitment, then the Holly Group will utilize the Refined Product
Pipelines for 100% of the available production from the Refineries to the extent
necessary and available to satisfy the Minimum Revenue Commitment. In the event
that such production is insufficient to satisfy the Minimum Revenue Commitment,
then within 90 days of the delivery of the written notice of the planned shut
down or reconfiguration, the Holly Group shall (i) propose a new Minimum Revenue
Commitment, such that the ratio of the new Minimum Revenue Commitment under this
Agreement over the anticipated production level following the shut down or
reconfiguration will be approximately equal to the ratio of the original Minimum
Revenue Commitment under this Agreement over the original production level and
(ii) propose the date on which the new Minimum Revenue Commitment shall take
effect. Unless objected to by the Partnership Entities within 60 days of receipt
by the Partnership Group of such proposal, such new Minimum Revenue Commitment
shall become effective as of the date proposed by the Holly Group. To the extent
that the Partnership Entities do not agree with the Holly Group's proposal, any
changes in the Holly Group's obligations under this Agreement, or the date on
which such changes will take effect, will be determined by binding arbitration
in accordance with Section 10(f) of this Agreement.

      (b) Force Majeure. In the event that any party is rendered unable, wholly
or in part, by a Force Majeure event from performing its obligations under this
Agreement for a period of

                                       8

<PAGE>

more than 30 days, then upon the delivery of notice and full particulars of the
Force Majeure event in writing within a reasonable time after the occurrence of
the Force Majeure event relied on, the obligations of the parties, so far as
they are affected by the Force Majeure event, shall be suspended for the
duration of any inability so caused. Any suspension of the obligations of the
parties as a result of this Section 3(b) shall extend the term of this
Agreement. The Holly Group will be required to pay any amounts accrued and due
under this Agreement at the time of the Force Majeure event. The cause of the
Force Majeure event shall so far as possible be remedied with all reasonable
dispatch, except that no party shall be compelled to resolve any strikes,
lockouts or other industrial disputes other than as it shall determine to be in
its best interests. In the event a Force Majeure event prevents the Partnership
Group or the Holly Group from performing its obligations under this Agreement
for a period of more than one year, this Agreement may be terminated by the
Partnership Group or the Holly Group. Nothing in this Section 3(b) shall alter
the liability of the Partnership Group as set forth in the rules and regulations
tariffs for the Refined Product Pipelines attached hereto as Exhibit D and
Exhibit E.

      SECTION 4. AGREEMENT TO REMAIN SHIPPER

      With respect to any Refined Products that are produced at a Refinery and
transported in any Refined Product Pipeline or handled at any Refined Product
Terminal, the Holly Group agrees that it will continue its historical commercial
practice of owning such Refined Products from such point as such Refined
Products leave the Refinery until at least such point as they will not be
further transported in a Refined Product Pipeline or handled at a Refined
Product Terminal and to continue acting in the capacity of the shipper of any
such Refined Products for their own account at all times that such Refined
Products are in a Refined Product Pipeline or being handled at the Refined
Product Terminals.

      SECTION 5. AGREEMENT NOT TO CHALLENGE TARIFFS OR TERMINAL CHARGES

      The Holly Entities agree to any tariff rate changes for the Refined
Product Pipelines determined in accordance with this Agreement. The Holly
Entities agree (a) not to challenge, nor to cause their Controlled Affiliates to
challenge, nor to encourage or recommend to any other Person that it challenge,
or voluntarily assist in any way any other Person in challenging, in any forum,
interstate or intrastate tariffs (including joint tariffs) of the Partnership
Group that the Partnership Group has filed or may file containing rates, rules
or regulations that are in effect at any time during the term of this Agreement
and regulate the transportation of Refined Products, (b) not to protest or file
a complaint, nor cause their Controlled Affiliates to protest or file a
complaint, nor encourage or recommend to any other Person that it protest or
file a complaint, or voluntarily assist in any way any other Person in
protesting or filing a complaint, with respect to regulatory filings that the
Partnership Group has made or may make at any time during the term of this
Agreement to change interstate or intrastate tariffs (including joint tariffs)
for transportation of Refined Products and (c) not to seek, nor cause their
Controlled Affiliates to seek, nor encourage or recommend to any other Person
that it seek, or voluntarily assist in any way any other Person in seeking,
regulatory review of, or regulatory jurisdiction over, the contractual rates
charged at any time during the term of this Agreement by the Partnership Group
for terminalling services or to challenge, in any forum, such rates or changes
to such rates, in each case so long as such tariffs, regulatory filings or rates
changed do not conflict with the terms of this Agreement.

                                       9

<PAGE>

      SECTION 6. EFFECTIVENESS AND TERM

      This Agreement shall be effective as of July 13, 2004 and shall terminate
at 12:01 a.m. Dallas, Texas, time on July 1, 2019, unless extended by written
mutual agreement of the parties hereto or as set forth in Section 7; provided,
however, that Section 5 shall survive the termination of this Agreement.

      SECTION 7. RIGHT TO ENTER INTO A NEW AGREEMENT

      For a period of one year following termination without renewal of this
Agreement, the Holly Entities will have the right to enter into a new pipelines
and terminals agreement with the Partnership Entities on commercial terms that
substantially match the terms which the Partnership Group proposes to enter into
an agreement with a third party for similar services. The Partnership Group
shall give the Holly Group 45 days prior written notice of any proposed new
pipelines and terminals agreement with a third party, and shall inform the Holly
Group of the fee schedules, tariffs, duration and any other terms of the
proposed third party agreement.

      SECTION 8. NOTICES

      All notices or requests or consents provided for by, or permitted to be
given pursuant to, this Agreement must be in writing and must be given by
depositing same in the United States mail, addressed to the Person to be
notified, postpaid, and registered or certified with return receipt requested or
by delivering such notice in person or by telecopier or telegram to such party.
Notice given by personal delivery or mail shall be effective upon actual
receipt. Notice given by telegram or telecopier shall be effective upon actual
receipt if received during the recipient's normal business hours or at the
beginning of the recipient's next business day after receipt if not received
during the recipient's normal business hours. All notices to be sent to a party
pursuant to this Agreement shall be sent to or made at the address set forth
below or at such other address as such party may stipulate to the other parties
in the manner provided in this Section 8:

                           if to the Holly Entities:

                           Holly Corporation
                           100 Crescent Court
                           Suite 1600
                           Dallas, Texas 75201
                           Attn: Matthew P. Clifton
                           Telecopy: 1-214-615-9372

                                       10

<PAGE>

                           if to the Partnership Entities:

                           Holly Energy Partners, L.P.
                           c/o Holly Logistic Services, L.L.C.
                           100 Crescent Court
                           Suite 1600
                           Dallas, Texas 75201
                           Attn: James G. Townsend
                           Telecopy: 1-505-748-6827

      SECTION 9. DEFICIENCY PAYMENTS

      (a) As soon as practicable following the end of each Contract Quarter
under this Agreement, the Partnership Group shall deliver to the Holly Group a
written notice (the "Deficiency Notice") detailing any failure of the Holly
Group to meet any of its obligations under Section 2(a) of this Agreement. The
Deficiency Notice shall (i) specify in reasonable detail the nature of any
deficiency and (ii) specify the approximate dollar amount that the Partnership
Group believes would have been paid by the Holly Group to the Partnership Group
if the Holly Group had complied with Section 2(a) of this Agreement (the
"Deficiency Payment"). The Holly Group shall pay the Deficiency Payment to the
Partnership Group upon the later of: (1) 10 days after its receipt of the
Deficiency Notice and (2) 30 days following the end of the related Contract
Quarter.

      (b) If the Holly Group disagrees with the Deficiency Notice, then
following the payment of the Deficiency Payment to the Partnership Group, the
chief financial officers of Holly (on behalf of the Holly Group) and Holly GP
(on behalf of the Partnership Group) shall meet or communicate by telephone at a
mutually acceptable time and place, and thereafter as often as they reasonably
deem necessary and shall negotiate in good faith to attempt to resolve any
differences that they may have with respect to matters specified in the
Deficiency Notice. During the 30-day period following the payment of the
Deficiency Payment, the Holly Group shall have access to the working papers of
the Partnership Group relating to the Deficiency Notice. If such differences are
not resolved within 30 days following the payment of the Deficiency Payment, the
Holly Group and the Partnership Group shall, within 45 days following the
payment of the Deficiency Payment, submit any and all matters which remain in
dispute and which were properly included in the Deficiency Notice to arbitration
in accordance with Section 10(f).

      (c) If it is finally determined pursuant to this Section 9 that the Holly
Group is not required to make any or all of the Deficiency Payment (the
"Refund"), the Partnership Group shall promptly pay to the Holly Group the
Refund, together with interest thereon at the Prime Rate, in immediately
available funds.

      (d) Deficiency Payments will be credited against any payments owed by the
Holly Group in the following four Contract Quarters in excess of the Minimum
Revenue Commitments established by this Agreement for such Calendar Quarters;
provided, however, that the Holly

                                       11

<PAGE>

Group will not receive credit for any Deficiency Payment in any of the following
four Contract Quarters until it has met the Minimum Revenue Commitment in the
succeeding Contract Quarter.

      SECTION 10. MISCELLANEOUS

      (a) Intention as to Refineries. The Holly Entities represent to the
Partnership Entities that, as of the date of this Agreement, they are not
considering a shut down of any of the Refineries or any changes to any of the
Refineries that would have a material adverse effect on the operation of any of
the Refineries.

      (b) Amendments and Waivers. No amendment or modification of this Agreement
shall be valid unless it is in writing and signed by the parties hereto and, in
the case of any amendment or modification adverse to the Partnership Group,
approved by the Conflicts Committee of Holly GP. No waiver of any provision of
this Agreement shall be valid unless it is in writing and signed by the party
against whom the waiver is sought to be enforced, and, in the case of any waiver
by the Partnership Entities, approved by the Conflicts Committee of Holly GP. No
failure or delay in exercising any right hereunder, and no course of conduct,
shall operate as a waiver of any provision of this Agreement. No single or
partial exercise of a right hereunder shall preclude further or complete
exercise of that right or any other right hereunder.

      (c) Successors and Assigns. This Agreement shall inure to the benefit of,
and shall be binding upon, the Holly Entities, the Partnership Entities and
their respective successors and permitted assigns. Neither this Agreement nor
any of the rights or obligations hereunder shall be assigned without the prior
written consent of Holly (in the case of any assignment by the Partnership
Entities) or the Conflicts Committee of Holly GP (in the case of any assignment
by the Holly Entities); provided, however, that (i) the Partnership Entities may
make such an assignment (including a partial pro rata assignment) to an
Affiliate of the Partnership Entities and (ii) any Holly Group Member may make
such an assignment to any Person to which such Holly Group Member has sold any
of its assets which assets rely on the services provided by the Partnership
Group under this Agreement if such Person (A) is reasonably capable of
performing the Holly Group's obligations (or its pro rata portion of such
obligations) under this Agreement assigned to such Person, which determination
shall be made by the Holly Group in its reasonable judgment and (B) has agreed
in writing with the Partnership Group to assume the obligations of the Holly
Group assigned to such Person and (iii) the Partnership Group may make such an
assignment to any Person to which the Partnership Group has sold any of its
transportation, storage or terminalling assets which assets provide services to
the Holly Group under this Agreement if such Person (A) is reasonably capable of
performing the Partnership Group's obligations (or its pro rata portion of such
obligations) under this Agreement assigned to such Person, which determination
shall be made by the Partnership Group in its reasonable judgment and (B) has
agreed in writing with the Holly Group to assume the obligations of the
Partnership Group assigned to such Person. Any attempt to make an assignment
otherwise than as permitted by the foregoing shall be null and void. The parties
hereto agree to require their respective successors, if any, to expressly
assume, in a form of agreement acceptable to the other parties, their
obligations under this Agreement.

                                       12

<PAGE>

      (d) Severability. If any provision of this Agreement shall be held invalid
or unenforceable by a court or regulatory body of competent jurisdiction, the
remainder of this Agreement shall remain in full force and effect.

      (e) Choice of Law. This Agreement shall be subject to and governed by the
laws of the State of Texas, excluding any conflicts-of-law rule or principle
that might refer the construction or interpretation of this Agreement to the
laws of another state.

      (f) Arbitration Provision. Any and all Arbitrable Disputes must be
resolved through the use of binding arbitration using three arbitrators, in
accordance with the Commercial Arbitration Rules of the American Arbitration
Association, as supplemented to the extent necessary to determine any procedural
appeal questions by the Federal Arbitration Act (Title 9 of the United States
Code). If there is any inconsistency between this Section and the Commercial
Arbitration Rules or the Federal Arbitration Act, the terms of this Section will
control the rights and obligations of the parties. Arbitration must be initiated
within the time limits set forth in this Agreement, or if no such limits apply,
then within a reasonable time or the time period allowed by the applicable
statute of limitations. Arbitration may be initiated by a party ("Claimant")
serving written notice on the other party ("Respondent") that the Claimant
elects to refer the Arbitrable Dispute to binding arbitration. Claimant's notice
initiating binding arbitration must identify the arbitrator Claimant has
appointed. The Respondent shall respond to Claimant within 30 days after receipt
of Claimant's notice, identifying the arbitrator Respondent has appointed. If
the Respondent fails for any reason to name an arbitrator within the 30-day
period, Claimant shall petition the American Arbitration Association for
appointment of an arbitrator for Respondent's account. The two arbitrators so
chosen shall select a third arbitrator within 30 days after the second
arbitrator has been appointed. The Claimant will pay the compensation and
expenses of the arbitrator named by or for it, and the Respondent will pay the
compensation and expenses of the arbitrator named by or for it. The costs of
petitioning for the appointment of an arbitrator, if any, shall be paid by
Respondent. The Claimant and Respondent will each pay one-half of the
compensation and expenses of the third arbitrator. All arbitrators must (a) be
neutral parties who have never been officers, directors or employees of any of
the Holly Entities, the Partnership Entities or any of their affiliates and (b)
have not less than seven years experience in the energy industry. The hearing
will be conducted in Dallas, Texas and commence within 30 days after the
selection of the third arbitrator. The Holly Entities, the Partnership Entities
and the arbitrators shall proceed diligently and in good faith in order that the
award may be made as promptly as possible. Except as provided in the Federal
Arbitration Act, the decision of the arbitrators will be binding on and
non-appealable by the parties hereto. The arbitrators shall have no right to
grant or award indirect, consequential, punitive or exemplary damages of any
kind.

      (g) Rights of Limited Partners. The provisions of this Agreement are
enforceable solely by the parties to this Agreement, and no Limited Partner of
the Partnership shall have the right, separate and apart from the Partnership,
to enforce any provision of this Agreement or to compel any party to this
Agreement to comply with the terms of this Agreement.

      (h) Further Assurances. In connection with this Agreement and all
transactions contemplated by this Agreement, each signatory party hereto agrees
to execute and deliver such additional documents and instruments and to perform
such additional acts as may be necessary or

                                       13

<PAGE>

appropriate to effectuate, carry out and perform all of the terms, provisions
and conditions of this Agreement and all such transactions.

                                       14

<PAGE>

      IN WITNESS WHEREOF, the undersigned parties have executed this Agreement
as of the date first written above.

                          HOLLY CORPORATION

                          By: /s/ Stephen J. McDonnell
                              ----------------------------------------------
                              Stephen J. McDonnell
                              Vice President and Chief Financial Officer

                          NAVAJO REFINING COMPANY, L.P.

                          By:  NAVAJO REFINING GP, L.L.C.,
                               its general partner

                               By: /s/ Stephen J. McDonnell
                                   --------------------------------------------
                                   Stephen J. McDonnell
                                   Vice President and Chief Financial Officer

                          HOLLY REFINING AND MARKETING COMPANY

                          By: /s/ Stephen J. McDonnell
                              ----------------------------------------------
                              Stephen J. McDonnell
                              Vice President and Chief Financial Officer

                          HOLLY ENERGY PARTNERS, L.P.

                          By:  HEP LOGISTICS HOLDINGS, L.P.,
                               its general partner

                          By:  HOLLY LOGISTIC SERVICES, L.L.C.,
                               its general partner

                               By: /s/ Stephen J. McDonnell
                                   -------------------------------------------
                                   Stephen J. McDonnell
                                   Vice President and Chief Financial Officer

         Signature Page 1 of 2 to the Pipelines and Terminals Agreement

<PAGE>

                          HEP OPERATING COMPANY, L.P.

                          By:  HEP LOGISTICS GP, L.L.C.,
                               its general partner

                               By: /s/ Stephen J. McDonnell
                                   -------------------------------------------
                                   Stephen J. McDonnell
                                   Vice President and Chief Financial Officer

                          HEP LOGISTICS HOLDINGS, L.P.

                          By:  HOLLY LOGISTIC SERVICES, L.L.C.,
                               its general partner

                               By: /s/ Stephen J. McDonnell
                                   ------------------------------------------
                                   Stephen J. McDonnell
                                   Vice President and Chief Financial Officer

                          HOLLY LOGISTIC SERVICES, L.L.C.

                          By: /s/ Stephen J. McDonnell
                              -----------------------------------------------
                              Stephen J. McDonnell
                              Vice President and Chief Financial Officer

                          HEP LOGISTICS GP, L.L.C.

                          By: /s/ Stephen J. McDonnell
                              -----------------------------------------------
                              Stephen J. McDonnell
                              Vice President and Chief Financial Officer

         Signature Page 2 of 2 to the Pipelines and Terminals Agreement

<PAGE>

                                                                       EXHIBIT A

                            REFINED PRODUCT PIPELINES

<TABLE>
<CAPTION>
                                                       MILES OF
ORIGIN AND DESTINATION                                 PIPELINE             DIAMETER                CAPACITY
--------------------------------------------           --------             --------                ---------
                                                                            (inches)                 (bpd)
<S>                                                    <C>                  <C>                     <C>
Artesia, NM to El Paso, TX..................               156                    6                 24,000
Artesia, NM to Orla, TX to El Paso, TX......               215               8/12/8                 60,000(1)
Artesia, NM to Moriarty, NM(2)..............               215                 12/8                 45,000
Artesia, NM to Bloomfield, NM(2)............               406                 12/8                     (3)
</TABLE>

------------------
(1)  Includes 20,000 bpd of capacity on the Orla to El Paso segment of this
     pipeline that is leased to Alon.

(2)  The White Lakes Junction to Moriarty segment of the Artesia to Moriarty
     pipeline and the Moriarty to Bloomfield pipeline is leased from Enterprise
     Products Partners, L.P. under a long-term lease agreement.

(3)  Capacity for this pipeline is reflected in the information for the Artesia
     to Moriarty pipeline.

                                      A-1

<PAGE>

                                                                       EXHIBIT B

                           REFINED PRODUCTS TERMINALS

<TABLE>
<CAPTION>
                                                                                 STORAGE
                                                                                 CAPACITY          NUMBER OF
LOCATION                                                                         (BARRELS)           TANKS
------------------------------------------------------------------               ---------         ---------
<S>                                                                              <C>               <C>
El Paso, TX.......................................................                507,000              16
Moriarty, NM......................................................                189,000               9
Bloomfield, NM....................................................                193,000               7
Albuquerque, NM(1)................................................                 64,000               9
Tucson, AZ(2).....................................................                176,000               9
Mountain Home, ID(3)..............................................                120,000               3
Boise, ID(1)......................................................                111,000               9
Burley, ID(1).....................................................                 70,000               7
Spokane, WA.......................................................                333,000              32
Artesia facility truck rack.......................................                    N/A             N/A
Woods Cross facility truck rack...................................                    N/A             N/A
</TABLE>

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

(1)  The Partnership Group has a 50% ownership interest in these terminals. The
     capacity information represents the proportionate share of capacity
     attributable to this ownership interest.

(2)  The Tucson terminal consists of two parcels. On one parcel, the Partnership
     leases the underlying ground as a 50% co-tenant with a division of Kaneb
     Pipeline Co. pursuant to which the Partnership owns 50% of the improvements
     on that parcel. On the other parcel, the Partnership's joint venture with
     Kaneb leases the underlying ground and owns the improvements. The joint
     venture gives the Partnership rights to 100% of the terminal (for both
     parcels), which is operated by Kaneb for a fee.

(3)  Handles only jet fuel.

                                      B-1

<PAGE>

                                                                       EXHIBIT C

                                  FEE SCHEDULE

1.    The Holly Group will pay a terminal service fee of $0.30 per barrel for
      truck rack deliveries and $0.10 per barrel for pipeline deliveries at each
      of the Refined Product Terminals.

2.    The Holly Group will pay a service fee of $0.25 per barrel for truck rack
      deliveries for facilities located within Refineries.

3.    Each of the service fees listed on this Exhibit C will adjust at the
      beginning of each Contract Year by an amount equal to the percentage
      change between the two preceding Contract Years in the index comprised of
      comparable fees posted by Kinder Morgan at its Phoenix, Tucson and Las
      Vegas terminals.

                                       C-1

<PAGE>

                                                                       EXHIBIT D

                                       D-1

<PAGE>

                                                                       EXHIBIT E

                                       E-1

<PAGE>

                                                                       EXHIBIT F

                                       F-1

<PAGE>

                                                                       EXHIBIT G

                                       G-1