<PAGE>   1


                                                                   EXHIBIT 10.18

                            AMENDMENT NUMBER FIVE TO
                      AMENDED AND RESTATED CREDIT AGREEMENT
                             AND CONSENT AND WAIVER

                  This AMENDMENT NUMBER FIVE TO AMENDED AND RESTATED CREDIT
AGREEMENT AND CONSENT AND WAIVER (this "Amendment") is entered into as of
January 31, 2001, among DEVX ENERGY, INC., formerly known as Queen Sand
Resources, Inc., a corporation formed under the laws of the State of Delaware
("DEVX"); DEVX ENERGY, INC., formerly known as Queen Sand Resources, Inc., a
corporation formed under the laws of the State of Nevada ("Borrower"); each of
the lenders that is a signatory hereto (individually, a "Lender" and,
collectively, the "Lenders"); FOOTHILL CAPITAL CORPORATION, as administrative
agent for the Lenders (in such capacity, "Administrative Agent"); and ABLECO
FINANCE LLC, as collateral agent for the Lenders (in such capacity, "Collateral
Agent"), with reference to the following facts:

                  A. DEVX, Borrower, the Lenders signatory thereto,
                  Administrative Agent and Collateral Agent, heretofore have
                  entered into that certain Amended and Restated Credit
                  Agreement, dated as of October 22, 1999, as amended by that
                  certain Amendment Number One to Loan and Security Agreement,
                  dated as of May 23, 2000, as further amended by that certain
                  Amendment Number Two and Waiver and Consent to Loan and
                  Security Agreement, dated as of June 30, 2000, as further
                  amended by that certain Amendment Number Three to Amended and
                  Restated Credit Agreement, dated as of September 19, 2000, as
                  further amended by that certain Amendment Number Four and
                  Waiver and Consent to Loan and Security Agreement, dated as of
                  October 24, 2000 (as heretofore amended, supplemented, or
                  otherwise modified, the "Agreement").

                  B. Each of DEVX and Borrower has requested that the Lenders
                  (i) amend the Agreement to extend the Maturity Date from
                  October 22, 2001 to April 22, 2003; (ii) amend the Agreement
                  to modify the Applicable Margin; (iii) amend the Agreement to
                  modify the definition of Triggering Event; (iv) amend Section
                  8.11 of the Agreement to modify the hedging covenant; (v)
                  amend Section 9.07 of the Agreement to increase the non-oil &
                  gas lease payments limit and the oil & gas field operations
                  lease payments limit; (vi) amend Section 9.14 of the Agreement
                  to modify the asset disposition limit contained therein; (vii)
                  amend Section 9.22 of the Agreement to modify the capital
                  expenditures limits; and (xiii) consent to the sale of certain
                  properties, as described in more detail below and waive any
                  Event of Default that may be occasioned solely as a result of
                  such sale and release Collateral Agent's security interests in
                  such properties, as described in more detail below.

                  C. The Lenders, Collateral Agent, and Administrative Agent are
                  willing to (i) amend the Agreement to extend the Maturity Date
                  from October 22, 2001 to April 22, 2003; (ii) amend the
                  Agreement to modify the Applicable Margin; (iii) amend the
                  Agreement to modify the definition of Triggering Event, (iv)
                  amend Section


<PAGE>   2


                  8.11 of the Agreement to modify the hedging covenant; (v)
                  amend Section 9.07 of the Agreement to increase the non-oil &
                  gas lease payments limit and the oil & gas field operations
                  lease payments limit; (vi) amend Section 9.14 of the Agreement
                  to modify the asset disposition limit contained therein; (vii)
                  amend Section 9.22 of the Agreement to modify the capital
                  expenditures limits; and (xiii) consent to the sale of certain
                  properties, as described in more detail below and waive any
                  Event of Default that may be occasioned solely as a result of
                  such sale and release the Collateral Agent's security
                  interests in such properties, as described in more detail
                  below, all in accordance with the terms and conditions set
                  forth in this Amendment.

                  D. All capitalized terms used herein and not defined herein
                  shall have the meanings ascribed to them in the Agreement, as
                  amended hereby.

                  NOW, THEREFORE, in consideration of the above recitals and the
mutual premises contained herein, the Lenders signatory hereto, Administrative
Agent, Collateral Agent, DEVX, and Borrower hereby agree as follows:

                  1. AMENDMENTS TO THE AGREEMENT.

                           a. The following definitions contained in Section
1.02 of the Agreement are amended and restated in their entirety to read as
follows:

                  "Applicable Margin" shall mean, for each day a Loan is
         outstanding, 2.00% per annum; provided, however, that, as of any date
         of determination, in the event that (i) the Revolving Facility Usage is
         equal to or greater than $30,000,000 and (ii) the ratio of (A) the
         Dollar valuation of that component of the Borrowing Base determination
         made under clause (b) of the definition thereof to (B) the Revolving
         Facility Usage is less than 1.50 to 1:00, Applicable Margin shall mean
         3.50%.

                  "Maturity Date" shall mean, unless the Aggregate Maximum
         Credit Amounts are sooner terminated under Section 2.03(b) or the
         Indebtedness is sooner accelerated under Section 10.02 hereof, April
         22, 2003.

                  "Triggering Event" shall mean the occurrence of one or more of
         the following: (a) a Default or an Event of Default, or (b) in the
         event that the ratio of (1) the Dollar valuation of that component of
         the Borrowing Base determination made under clause (b) of the
         definition thereof to (2) the Revolving Facility Usage is equal to or
         greater than 1.50 to 1:00, the sum of Excess Availability plus the
         undrawn amount of uncancelled Letters of Credit supporting obligations
         of any Obligor under Risk Management Agreements is less than
         $5,000,000, or (c) in the event that the ratio of (1) the Dollar
         valuation of that component of the Borrowing Base determination made
         under clause (b) of the definition thereof to (2) the Revolving
         Facility Usage is less than 1.50 to 1:00, Excess Availability is less
         than $5,000,000, or (d) a Material Adverse Effect.

                  b. The definition of "Consolidated Net Income" contained in
Section 1.02 of the Agreement is amended by amending and restating clause (iv)
thereof, in its entirety, to read as follows:


                                       2
<PAGE>   3



                  (iv) any extraordinary gains, including gains attributable to
                  Property sales not in the ordinary course of business and any
                  gains or losses attributable to the termination or liquidation
                  of, or resulting from the application of Statement No. 133 of
                  the Financial Accounting Standards Board to, Risk Management
                  Agreements;

                  c. Section 8.01(k) of the Agreement is hereby amended and
restated, in its entirety, to read as follows:

                  (k) Intentionally Omitted.

                  d. Section 8.01(m) of the Agreement is hereby amended by
replacing the phrase "June 30th Reserve Report" contained therein with the
phrase "December 31 Reserve Report".

                  e. Section 8.11 of the Agreement is amended by deleting the
text "fifty percent (50%)" appearing twice in such Section and inserting the
text "forty percent (40%)" in lieu thereof.

                  f. Section 9.07 of the Agreement is amended by (i) deleting
the text "$500,000" appearing in said Section and inserting the text
"$1,000,000" in lieu thereof; and (ii) deleting the text "$4,000,000" appearing
in said Section and inserting the text "$8,000,000" in lieu thereof.

                  g. Section 9.12(a) of the Agreement is amended by adding the
text "and with respect to both clauses (i) and (ii), without giving effect to
the impact, if any, of Statement No. 133 of the Financial Accounting Standards
Board" immediately after the text "(excluding current maturities of the
Indebtedness)" appearing in said Section.

                  h. Section 9.14 of the Agreement is amended by deleting the
text "$1,000,000" appearing in said Section and inserting the text "$2,000,000"
in lieu thereof.

                  i. Section 9.22 of the Agreement is amended and restated in
its entirety to read as follows:

                  Section 9.22. Limitations on Capital Expenditures. DEVX and
         the Borrower shall not, and shall not permit any Subsidiaries to, make
         or pay any capital expenditures (other than maintenance and emergency
         capital expenditures and capital expenditures constituting Permitted
         Acquisitions) if, after giving effect thereto, (i) the aggregate of all
         such capital expenditures made or paid during the twelve month period
         ending as of each of the dates set forth below, exceeds the relevant
         amount set forth in the following table:



                                       3
<PAGE>   4


<TABLE>
<CAPTION>
Period Ending                                     Amount
-------------                                     ------
<S>                                            <C>

January 31, 2001                                $18,000,000

February 28, 2001                               $19,000,000

March 31, 2001                                  $20,000,000

April 30, 2001                                  $23,000,000

May 31, 2001                                    $24,000,000

June 30, 2001                                   $25,000,000

July 31, 2001                                   $28,000,000

August 31, 2001                                 $28,000,000

September 30, 2001                              $29,000,000

October 31, 2001 and the last day of each       $30,000,000
successive month thereafter
</TABLE>

         (ii) the aggregate of all such capital expenditures made or paid during
         the period from January 1, 2001 through and including April 22, 2003,
         to exceed, in the aggregate, $70,000,000; or (iii) the aggregate of all
         such capital expenditures made or paid during any calendar quarter, to
         exceed 133% of the amount for capital expenditures for the applicable
         quarter as set forth in the current budget delivered to each Agent
         pursuant to Section 8.01(m).

                  2. CONSENT AND WAIVER.

                  The Lenders hereby consent to the sale by Borrower of those
properties commonly known as (1) the Melvin Field, Clarke County, Mississippi,
(2) the West Cap Field, Chaves County, New Mexico, (3) the Ramos Field, St. Mary
Parish, Louisiana, and (4) the wells in Martin County, Texas, all as more
particularly described on Exhibit B hereto (collectively, the "Properties"), and
hereby waive any Event of Default that may be occasioned solely as a result of
such sale. In addition, the Lenders hereby release their Liens in the
Properties, and shall promptly execute and deliver such other documents,
instruments and other agreements as may be reasonably requested by Borrower to
fully effect the release of such Liens.

                  3. CONDITIONS PRECEDENT TO THE EFFECTIVENESS OF THIS
                     AMENDMENT.

                  The effectiveness of this Amendment is subject to the
fulfillment, to the satisfaction of Agents and their counsel, of each of the
following conditions:

         a. Collateral Agent shall have received each of the following
documents, in form and substance satisfactory to Collateral Agent and its
counsel, duly executed, and each such document shall be in full force and
effect:

                  (i) this Amendment; and



                                       4
<PAGE>   5


                  (ii) the Reaffirmation and Consent (as hereinafter defined).

         b. Administrative Agent shall have received, for the ratable benefit of
the Lenders, an amendment, consent, and waiver fee of $125,000, which fee is
earned in full by the Lenders, due and payable by Borrower to the Lenders on the
date hereof, and non-refundable when paid;

         c. The representations and warranties in Section 4 of this Amendment,
the Agreement as amended by Section 1 of this Amendment, and the other Loan
Documents shall be true and correct in all material respects on and as of the
date hereof, as though made on such date (except to the extent that such
representations and warranties relate solely to an earlier date);

         d. After giving effect hereto, no Event of Default or event which with
the giving of notice or passage of time would constitute an Event of Default
shall have occurred and be continuing on the date hereof, nor shall result from
the amendments herein;

         e. No material adverse change shall have occurred in the financial
condition of DEVX, Borrower, any Subsidiary Guarantor, or in the value of the
Collateral; and

         f. All other documents and legal matters in connection with the
transactions contemplated by this Amendment shall have been delivered or
executed or recorded and shall be in form and substance reasonably satisfactory
to Collateral Agent and its counsel.

                  4. REPRESENTATIONS AND WARRANTIES. Each of DEVX and the
Borrower hereby represents and warrants to the Agents and the Lenders that: (a)
the execution, delivery, and performance of this Amendment and of the Agreement,
as amended by this Amendment, are within its corporate powers, have been duly
authorized by all necessary corporate action, and are not in contravention of
any law, rule, or regulation, or any order, judgment, decree, writ, injunction,
or award of any arbitrator, court, or governmental authority, or of the terms of
its charter or bylaws, or of any contract or undertaking to which it is a party
or by which any of its properties may be bound or affected; and (b) this
Amendment and the Agreement, as amended by this Amendment, constitute the legal,
valid, and binding obligation of each of DEVX and the Borrower, enforceable
against each of DEVX and the Borrower in accordance with their respective terms.

                  5. REAFFIRMATION AND CONSENT. Concurrently herewith, DEVX and
the Borrower shall cause each current Subsidiary Guarantor to execute and
deliver to the Agents the Reaffirmation and Consent attached hereto as Exhibit A
(the "Reaffirmation and Consent").

                  6. CHOICE OF LAW AND VENUE; JURY TRIAL WAIVER. Section 12.13
of the Agreement is incorporated herein by this reference as though fully set
forth herein.

                  7. MISCELLANEOUS.

         a. Upon the effectiveness of this Amendment, each reference in the
Agreement to "this Agreement", "hereunder", "herein", "hereof" or words of like
import referring to the Agreement shall mean and refer to the Agreement as
amended by this Amendment.

         b. Upon the effectiveness of this Amendment, each reference in the Loan
Documents to the "Agreement", "thereunder", "therein", "thereof" or words of
like import referring to the Agreement shall mean and refer to the Agreement as
amended by this Amendment.


                                       5
<PAGE>   6


         c. This Amendment may be executed in any number of counterparts, all of
which taken together shall constitute one and the same instrument and any of the
parties hereto may execute this Amendment by signing any such counterpart.
Delivery of an executed counterpart of this Amendment by telefacsimile shall be
equally as effective as delivery of a manually executed counterpart of this
Amendment. Any party delivering an executed counterpart of this Amendment by
telefacsimile also shall deliver a manually executed counterpart of this
Amendment but the failure to deliver a manually executed counterpart shall not
affect the validity, enforceability, and binding effect of this Amendment.

                  [Remainder of page intentionally left blank.]









                                       6
<PAGE>   7



                  IN WITNESS WHEREOF, the parties hereto have caused this
Amendment to be executed as of the date first written above.


DEVX:                                    DEVX ENERGY, INC., formerly known as
                                         Queen Sand Resources, Inc., a Delaware
                                         corporation

                                         By: /s/ William W. Lesikar
                                             -------------------------------
                                             William W. Lesikar
                                             Vice President

BORROWER:                                DEVX ENERGY, INC., formerly known as
                                         Queen Sand Resources, Inc., a Nevada
                                         corporation

                                         By: /s/ William W. Lesikar
                                             -------------------------------
                                             William W. Lesikar
                                             Vice President

                                         Address for Notices for DEVX and the
                                         Borrower:

                                         DevX Energy, Inc., formerly known as
                                         Queen Sand Resources, Inc.
                                         13760 Noel Road, Suite 1030
                                         Dallas, Texas 75240
                                         Attention: Mr. William W. Lesikar
                                         Telephone: (972) 233-9906
                                         Facsimile: (972) 233-9575

                                         with a copy to:

                                         DevX Energy, Inc., formerly known as
                                         Queen Sand Resources, Inc.
                                         30 Metcalfe Street
                                         Ottawa, Canada KIP 5L4
                                         Attention: Mr. Brian J. Barr
                                         Telephone: (613) 230-7211
                                         Facsimile: (613) 230-6055

                                         And

                                         Haynes & Boone LLP
                                         1600 North Collins Street, Suite 2000
                                         Richardson, Texas 75080
                                         Attention: Mr. William L. Boeing
                                         Telephone: (972) 580-7553
                                         Facsimile: (972) 692-9053



                                       7
<PAGE>   8


COLLATERAL AGENT:                          ABLECO FINANCE LLC, as Collateral
                                           Agent


                                           By: /s/ Kevin P. Genda
                                               -------------------------
                                               Kevin P. Genda
                                               Senior Vice President and
                                               Chief Credit Officer

                                           Address for Notices:

                                           450 Park Avenue.
                                           New York, New York 10022
                                           Attention: Kevin P. Genda
                                           Telephone: (212) 891-2117
                                           Facsimile: (212) 755-3009

                                           with a copy to:

                                           BROBECK PHLEGER & HARRISON LLP
                                           550 South Hope Street, Suite 2100
                                           Los Angeles, California 90071
                                           Attention: John Francis Hilson, Esq.
                                           Telephone: (213) 489-4060
                                           Facsimile: (213) 745-3345







                                       8
<PAGE>   9





ADMINISTRATIVE AGENT:               FOOTHILL CAPITAL CORPORATION

                                    By: /s/ Authorized Signatory
                                        ----------------------------------------

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

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

                                    Address for Notices:

                                    2450 Colorado Avenue
                                    Suite 3000 West
                                    Santa Monica, California 90404
                                    Attention: Business Finance Division Manager
                                    Telephone: (310) 453-7300
                                    Facsimile: (310) 478-9788










                                       9
<PAGE>   10






LENDER:                             ABLECO FINANCE LLC


                                    By: /s/ Kevin P. Genda
                                        ---------------------------
                                        Kevin P. Genda
                                        Senior Vice President and
                                        Chief Credit Officer



LENDER:                             FOOTHILL CAPITAL CORPORATION


                                    By: /s/ Authorized Signatory
                                        ----------------------------------------

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

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









                                       10
<PAGE>   11



                                    EXHIBIT A

                            REAFFIRMATION AND CONSENT

         All capitalized terms used herein but not otherwise defined herein
shall have the meanings ascribed to them in that certain Amendment Number Five
to Amended and Restated Credit Agreement and Consent and Waiver, dated as of
January 31, 2001 (the "Amendment"). Each of the undersigned hereby (a)
represents and warrants to the Agents and the Lenders that the execution,
delivery, and performance of this Reaffirmation and Consent are within its
corporate powers, have been duly authorized by all necessary corporate action,
and are not in contravention of any law, rule, or regulation, or any order,
judgment, decree, writ, injunction, or award of any arbitrator, court, or
governmental authority, or of the terms of its charter or bylaws, or of any
contract or undertaking to which it is a party or by which any of its properties
may be bound or affected; (b) consents to the amendment of the Agreement by the
Amendment; (c) acknowledges and reaffirms its obligations owing to the Agents
and the Lenders under its respective Second Amended and Restated Guaranty
Agreement dated as of October 22, 1999 (each a "Guaranty", and collectively, the
"Guaranties") and any other Loan Documents to which it is party; and (d) agrees
that the Guaranty and any other Loan Documents to which it is a party is and
shall remain in full force and effect. Although each of the undersigned has been
informed of the matters set forth herein and has acknowledged and agreed to
same, it understands that the Agents and the Lenders have no obligation to
inform it of such matters in the future or to seek its acknowledgement or
agreement to future amendments, and nothing herein shall create such a duty.
This Reaffirmation and Consent may be executed in any number of counterparts and
by different parties on separate counterparts, each of which, when executed and
delivered, shall be deemed to be an original, and all of which, when taken
together, shall constitute but one and the same Reaffirmation and Consent.
Delivery of an executed counterpart of this Reaffirmation and Consent by
telefacsimile shall be equally as effective as delivery of an original executed
counterpart of this Reaffirmation and Consent. Any party delivering an executed
counterpart of this Reaffirmation and Consent by telefacsimile also shall
deliver an original executed counterpart of this Reaffirmation and Consent but
the failure to deliver an original executed counterpart shall not affect the
validity, enforceability, and binding effect of this Reaffirmation and Consent.
This Reaffirmation and Consent shall be governed by internal laws of the State
of New York as more fully set forth in Section 5.04 of the Guaranties.


                                      DEVX ENERGY, INC., formerly known as
                                      Queen Sand Resources, Inc., a Delaware
                                      corporation

                                      By: /s/ William W. Lesikar
                                          -------------------------------
                                          William W. Lesikar
                                          Vice President







                                       11
<PAGE>   12


                                      DEVX OPERATING COMPANY, formerly
                                      known as Queen Sand Operating Co., a
                                      Nevada corporation

                                      By: /s/ William W. Lesikar
                                          --------------------------------------
                                          William W. Lesikar
                                          Vice President

                                      CORRIDA RESOURCES, INC.,
                                      a Nevada corporation

                                      By: /s/ William W. Lesikar
                                          --------------------------------------
                                          William W. Lesikar
                                          Vice President








                                       12