<PAGE>

                                                                    EXHIBIT 10.4

                           AMENDMENT NO. 2 AND CONSENT

      This Amendment No. 2 and Consent ("Agreement") dated as of February 7,
2005 ("Effective Date") is among Mariner Energy, Inc., a Delaware corporation
(the "Borrower"), Mariner Holdings, Inc. and Mariner Energy, LLC, the Lenders
(as defined below), and Union Bank of California, N.A., as administrative agent
for such Lenders (in such capacity, the "Administrative Agent") and as issuing
lender for such Lenders (in such capacity, the "Issuing Lender").

                                    RECITALS

      A. The Borrower, the Lenders, Issuing Lender and the Administrative Agent
are parties to the Credit Agreement dated as of March 2, 2004, as amended by
that certain Amendment No. 1 and Assignment Agreement dated as of July 14, 2004
(as so amended, the "Credit Agreement").

      B. In connection with the Credit Agreement, MARINER HOLDINGS, INC., a
Delaware corporation ("MHI"), which owns 100% of the equity interest in the
Borrower, executed and delivered (i) that certain Guaranty dated as of March 2,
2004 pursuant to which MHI guaranteed the obligations of the Borrower under the
Credit Agreement and the other Loan Documents ("MHI Guaranty") and (ii) that
certain Pledge Agreement dated as of March 2, 2004 among the Borrower, MHI and
MARINER ENERGY LLC, a Delaware limited liability company ("MELLC"), as
supplemented by that certain Supplement No. 1 dated as of December 29, 2004 (as
so supplemented, the "Pledge Agreement") pursuant to which MHI pledged to the
Administrative Agent as collateral, all equity interest in the Borrower held by
MHI ("MHI Collateral").

      C. Furthermore, in connection with the Credit Agreement, MELLC, which owns
100% of MHI, executed and delivered (i) that certain Guaranty dated as of March
2, 2004, as amended, pursuant to which MELLC guaranteed the obligations of the
Borrower under the Credit Agreement and the other Loan Documents (as so amended,
the "MELLC Guaranty") and (ii) the Pledge Agreement pursuant to which MELLC
pledged to the Administrative Agent as collateral, all equity interest in MHI
held by MELLC ("MELLC Collateral"; together with the MHI Collateral, the "Equity
Collateral").

      D. MHI, MELLC and the Borrower propose to enter into one or more merger
agreements, (collectively, the "Borrower Merger Agreement"), a copy of which is
attached hereto as Exhibit A, pursuant to which (i) MHI will merger with and
into the Borrower with the Borrower as the surviving entity and (ii) MELLC will
merge with and into the Borrower with the Borrower as the surviving entity
(collectively, the "Borrower Merger").

      E. Pursuant to Section 6.04 of the Credit Agreement, the Borrower may not
merge or consolidate with or into any other Person without the prior consent of
all of the Lenders.

      F. At the request of the Borrower, the Administrative Agent and the
Lenders wish to, subject to the terms and conditions of this Agreement, (i)
consent to the Borrower Merger being effected on terms set forth in the Borrower
Merger Agreement, (ii) consent to the release of the

<PAGE>

MHI Guaranty and the MELLC Guaranty, (iii) consent to the release of the Equity
Collateral, and (iii) amend certain provisions of the Credit Agreement as set
forth herein.

      THEREFORE, the Borrower, the subsidiaries of the Borrower signatory hereto
(the "Guarantors"), the Lenders, the Issuing Lender and the Administrative Agent
hereby agree as follows:

                                   ARTICLE I.
                                   DEFINITIONS

      SECTION 1.01 TERMS DEFINED ABOVE. As used in this Agreement, each of the
terms defined in the opening paragraph and the Recitals above shall have the
meanings assigned to such terms therein.

      SECTION 1.02 TERMS DEFINED IN THE CREDIT AGREEMENT. Each term defined in
the Credit Agreement and used herein without definition shall have the meaning
assigned to such term in the Credit Agreement, unless expressly provided to the
contrary.

      SECTION 1.03 OTHER DEFINITIONAL PROVISIONS. The words "hereby", "herein",
"hereinafter", "hereof", "hereto" and "hereunder" when used in this Agreement
shall refer to this Agreement as a whole and not to any particular Article,
Section, subsection or provision of this Agreement. Article, Section, subsection
and Exhibit references herein are to such Articles, Sections, subsections and
Exhibits of this Agreement unless otherwise specified. All titles or headings to
Articles, Sections, subsections or other divisions of this Agreement or the
exhibits hereto, if any, are only for the convenience of the parties and shall
not be construed to have any effect or meaning with respect to the other content
of such Articles, Sections, subsections, other divisions or exhibits, such other
content being controlling as the agreement among the parties hereto. Whenever
the context requires, reference herein made to the single number shall be
understood to include the plural; and likewise, the plural shall be understood
to include the singular. Words denoting sex shall be construed to include the
masculine, feminine and neuter, when such construction is appropriate; and
specific enumeration shall not exclude the general but shall be construed as
cumulative. Definitions of terms defined in the singular or plural shall be
equally applicable to the plural or singular, as the case may be, unless
otherwise indicated.

                                  ARTICLE II.
                                    CONSENTS

      SECTION 2.01 CONSENT; ACKNOWLEDGMENT; AGREEMENT. Subject to the terms of
this Agreement, the Lenders hereby consent to (a) the consummation of the
Borrower Merger on terms set forth in the Borrower Merger Agreement, (b) the
release and termination of the MHI Guaranty and the MELLC Guaranty, and (c) the
release of the Equity Collateral from any and all liens granted to the
Administrative Agent to secure the Obligations. The consents by the Lenders
described in this Section 2.01 are collectively referred to herein as the
"Consents." The Consents by the Lenders described in this Section 2.01 are
contingent upon the satisfaction of the conditions precedent set forth below.
Such Consents are strictly limited to the extent described herein. Nothing
contained herein shall be construed to be a consent to or a permanent waiver of
the Sections covered by the Consents provided for herein or any other terms,
provisions, covenants, warranties or agreements contained in the Credit
Agreement or in any of the other Loan Documents. The Lenders reserve the right
to exercise any rights and remedies available to

                                       2-

<PAGE>

them in connection with any other present or future defaults with respect to the
Credit Agreement or any other provision of any Loan Document. The descriptions
herein of the Consents are based upon the information provided to the Lenders on
or prior to the date hereof and shall not be deemed to exclude the existence of
any Defaults or Events of Default. The failure of the Lenders to give notice to
the Borrower or the Guarantors of any such Defaults or Events of Default is not
intended to be nor shall be a waiver thereof. The Borrower hereby agrees and
acknowledges that the Lenders require and will require strict performance by the
Borrower of all of its obligations, agreements and covenants contained in the
Credit Agreement and the other Loan Documents, and no inaction or action
regarding any Default or Event of Default is intended to be or shall be a waiver
thereof.

                                  ARTICLE III.
                          AMENDMENT TO CREDIT AGREEMENT

      SECTION 3.01 AMENDMENTS TO SECTION 1.01.

            (a) New Defined Terms: Section 1.01 of the Credit Agreement is
hereby amended by adding the following new defined terms in alphabetical order:

            "Amendment No. 2" shall mean that certain Amendment No. 2 and
      Consent dated as of January 31, 2005 among the Borrower, the Lenders and
      the Administrative Agent.

            "Borrower Merger" shall have the meaning assigned in Amendment No.
      2.

            "Borrower Merger Agreement" shall have the meaning assigned in
      Amendment No. 2.

            (b) Revision to Defined Term. Section 1.01 of the Credit Agreement
is hereby further amended by deleting the definition of "Change in Control" and
replacing it in its entirety with the following:

            "Change in Control" shall mean the occurrence of any of the
      following events:

            (a) the Borrower shall cease to, directly or indirectly, own 100% of
      the Equity Interests of its Subsidiaries;

            (b) MEI Holdings, ACON Investments LLC, Riverstone Holdings, LLC and
      their respective Affiliates (other than portfolio companies of such
      institutions), Affiliates of the Administrative Agent and employees and
      directors of the Borrower, cease to collectively own more than 50% of the
      Equity Interests of the Borrower;

            (c) during any period of 12 consecutive months occurring after the
      Closing Date, a majority of the members of the board of directors or other
      equivalent governing body of the Borrower ceases to be composed of
      individuals (i) who were members of that board or equivalent governing
      body on the first day of such period, (ii) whose election or nomination to
      that board or equivalent governing body was approved by individuals
      referred to in clause (i) above constituting at the time of such election
      or nomination at least a majority of that

                                       3-

<PAGE>

      board or equivalent governing body or (iii) whose election or nomination
      to that board or other equivalent governing body was approved by
      individuals referred to in clauses (i) and (ii) above constituting at the
      time of such election or nomination at least a majority of that board or
      equivalent governing body (excluding, in the case of both clause (ii) and
      clause (iii), any individual whose initial nomination for, or assumption
      of office as, a member of that board or equivalent governing body occurs
      as a result of an actual or threatened solicitation of proxies or consents
      for the election or removal of one or more directors by any person or
      group other than a solicitation for the election of one or more directors
      by or on behalf of the board of directors); or

            (d) Scott Josey ceases to be the Chief Executive Officer or
      President of the Borrower or to be actively engaged in the executive
      management of the Borrower and is not replaced with an individual of
      comparable qualifications within six months after he ceases to be the
      Chief Executive Officer or President of the Borrower or to be actively
      engaged in the executive management of the Borrower (and the Borrower
      hereby agrees to consult with the Lenders regarding any such potential
      replacement).

      SECTION 3.02 AMENDMENT TO SECTION 6.21. Section 6.21 of the Credit
Agreement is hereby amended by deleting the last sentence thereof and replacing
it in its entirety with the following:

      "Additionally, the Borrower may not amend, modify, supplement or waive any
      of the terms of (a) the Merger Agreement and the other related Merger
      Documents (excluding the Project Company Note and the Project Company
      Mortgage which are both governed by the preceding sentence) or (b) the
      Borrower Merger Agreement, without the prior written consent of the
      Required Lenders (which consent shall not be unreasonably withheld or
      delayed) unless, in any case, such amendment, modification, supplement or
      waiver is immaterial in nature and could not reasonably be expected to be
      adverse to the Administrative Agent, the Issuing Lender or the Lenders."

      SECTION 3.03 AMENDMENT TO SECTION 8.03. Section 8.03 of the Credit
Agreement is hereby amended by deleting the last sentence thereof and replacing
it in its entirety with the following:

      "Additionally, an Affiliate of the Administrative Agent has made an equity
      investment in MEI Holdings and may from time to time make additional
      equity investments in such entity or in the Borrower or its affiliates."

                                  ARTICLE IV.
                         REPRESENTATIONS AND WARRANTIES

      SECTION 4.01 BORROWER REPRESENTATIONS AND WARRANTIES. The Borrower
represents and warrants that: (a) the representations and warranties contained
in Article IV of the Credit Agreement and the representations and warranties
contained in the Security Instruments, the Guaranties, and each of the other
Loan Documents are true and correct in all material respects on

                                       4-

<PAGE>

and as of the Effective Date, after giving effect to the terms of this
Agreement, as though made on and as of such date, except those representations
and warranties that speak of a certain date, which representations and
warranties were true and correct as of such date; (b) after giving effect to the
terms of this Agreement, no Default has occurred and is continuing; (c) the
execution, delivery and performance of this Agreement are within the corporate
power and authority of the Borrower and have been duly authorized by appropriate
corporate action and proceedings; (d) this Agreement constitutes a legal, valid,
and binding obligation of the Borrower enforceable in accordance with its terms,
except as limited by applicable bankruptcy, insolvency, reorganization,
moratorium, or similar laws affecting the rights of creditors generally and
general principles of equity; (e) there are no governmental or other third party
consents, licenses and approvals required in connection with the execution,
delivery, performance, validity and enforceability of this Agreement; and (f)
the Liens under the Security Instruments are valid and subsisting and secure
Borrower's obligations under the Loan Documents.

      SECTION 4.02 GUARANTORS REPRESENTATIONS AND WARRANTIES. Each Guarantor
represents and warrants that: (a) the representations and warranties contained
in Article IV of the Credit Agreement and the representations and warranties
contained in the Security Instruments, the Guaranties, and each of the other
Loan Documents are true and correct in all material respects on and as of the
Effective Date, as though made on and as of such date, except those
representations and warranties that speak of a certain date, which
representations and warranties were true and correct as of such date; (b) after
giving effect to the terms of this Agreement, no Default has occurred and is
continuing; (c) the execution, delivery and performance of this Agreement are
within the corporate power and authority of such Guarantor and have been duly
authorized by appropriate corporate action and proceedings; (d) this Agreement
constitutes a legal, valid, and binding obligation of such Guarantor enforceable
in accordance with its terms, except as limited by applicable bankruptcy,
insolvency, reorganization, moratorium, or similar laws affecting the rights of
creditors generally and general principles of equity; (e) there are no
governmental or other third party consents, licenses and approvals required in
connection with the execution, delivery, performance, validity and
enforceability of this Agreement; (f) it has no defenses to the enforcement of
its Guaranty; and (g) the Liens under the Security Instruments are valid and
subsisting and secure such Guarantor's obligations under the Loan Documents.

                                   ARTICLE V.
                                   CONDITIONS

      This Agreement and the Consents contained herein shall become effective
and enforceable against the parties hereto, and the Credit Agreement shall be
amended as provided herein, upon the occurrence of the following conditions
precedent:

      SECTION 5.01 DOCUMENTS; CERTIFICATES. The Administrative Agent shall have
received multiple original counterparts, as requested by the Administrative
Agent, of:

            (a) this Agreement duly and validly executed and delivered by duly
authorized officers of the Borrower, the Guarantors, the Administrative Agent,
and the Lenders,

            (b) a certificate of the secretary of the Borrower certifying true,
correct and complete copies of (A) the resolutions of the board of directors of
the Borrower, authorizing and approving Borrower Merger and the execution,
delivery and performance of the Borrower

                                       5-

<PAGE>

Merger Agreement, this Agreement and the other Loan Documents delivered in
connection herewith, (B) the certificates of merger for the Borrower Merger, (C)
all other documents evidencing other necessary corporate action and governmental
approvals, if any, with respect to the Loan Documents delivered in connection
herewith, and (D) the Borrower Merger Agreement and all exhibits and schedules
thereto, and any and all material agreements executed in connection with the
Borrower Merger Agreement; and

            (c) such other instruments, documents and amendments or supplements
as the Administrative Agent may reasonably request.

      SECTION 5.02 NO DEFAULT. No Default shall have occurred and be continuing
as of the Effective Date.

      SECTION 5.03 REPRESENTATIONS. The representations and warranties in this
Agreement shall be true and correct in all material respects.

                                  ARTICLE VI.
                                  MISCELLANEOUS

      SECTION 6.01 EFFECT ON LOAN DOCUMENTS; ACKNOWLEDGMENTS.

            (a) The Borrower acknowledges that on the date hereof all
Obligations are payable without defense, offset, counterclaim or recoupment.

            (b) The Administrative Agent, the Issuing Lender, and the Lenders
hereby expressly reserve all of their rights, remedies, and claims under the
Loan Documents. Nothing in this Agreement shall constitute a waiver or
relinquishment of (i) any Default or Event of Default under any of the Loan
Documents other than as expressly set forth above, (ii) any of the agreements,
terms or conditions contained in any of the Loan Documents other than as
expressly set forth above, (iii) any rights or remedies of the Administrative
Agent, the Issuing Lender or any Lender with respect to the Loan Documents, or
(iv) the rights of the Administrative Agent, any Issuing Lender or any Lender to
collect the full amounts owing to them under the Loan Documents.

            (c) Each of the Borrower, the Guarantors, Administrative Agent,
Issuing Lender, and Lenders does hereby adopt, ratify, and confirm the Credit
Agreement, as amended hereby, and acknowledges and agrees that the Credit
Agreement, as amended hereby, and all other Loan Documents are and remain in
full force and effect, and each of the Borrower and the Guarantors acknowledges
and agrees that its liabilities under the Credit Agreement and the other Loan
Documents are not impaired in any respect by this Agreement or the consents
granted hereunder.

            (d) From and after the Effective Date, all references to the Credit
Agreement and the Loan Documents shall mean such Credit Agreement and such Loan
Documents as amended by this Agreement.

            (e) This Agreement is a Loan Document for the purposes of the
provisions of the other Loan Documents. Without limiting the foregoing, any
breach of representations,

                                       6-

<PAGE>

warranties, and covenants under this Agreement shall be a Default or Event of
Default, as applicable, under the Credit Agreement.

      SECTION 6.02 REAFFIRMATION OF THE GUARANTY. Each Guarantor hereby
ratifies, confirms, acknowledges and agrees that its obligations under its
Guaranty are in full force and effect and that such Guarantor continues to
unconditionally and irrevocably guarantee the full and punctual payment, when
due, whether at stated maturity or earlier by acceleration or otherwise, all of
the Guaranteed Obligations (as defined in its Guaranty), as such Guaranteed
Obligations may have been amended by this Agreement, and its execution and
deliver of this Agreement does not indicate or establish an approval or consent
requirement by such Guarantor under its Guaranty in connection with the
execution and delivery of amendments to the Credit Agreement, the Notes or any
of the other Loan Documents.

      SECTION 6.03 COUNTERPARTS. This Agreement may be signed in any number of
counterparts, each of which shall be an original and all of which, taken
together, constitute a single instrument. This Agreement may be executed by
facsimile signature and all such signatures shall be effective as originals.

      SECTION 6.04 SUCCESSORS AND ASSIGNS. This Agreement shall be binding upon
and inure to the benefit of the Lenders, the Borrower and the Administrative
Agent hereto and their respective successors and assigns permitted pursuant to
the Credit Agreement.

      SECTION 6.05 INVALIDITY. In the event that any one or more of the
provisions contained in this Agreement shall for any reason be held invalid,
illegal or unenforceable in any respect, such invalidity, illegality or
unenforceability shall not affect any other provision of this Agreement.

      SECTION 6.06 GOVERNING LAW. This Agreement shall be deemed to be a
contract made under and shall be governed by and construed in accordance with
the laws of the State of Texas.

      SECTION 6.07 ENTIRE AGREEMENT. THIS AGREEMENT, THE CREDIT AGREEMENT AS
AMENDED BY THIS AGREEMENT, THE NOTES, AND THE OTHER LOAN DOCUMENTS CONSTITUTE
THE ENTIRE UNDERSTANDING AMONG THE PARTIES HERETO WITH RESPECT TO THE SUBJECT
MATTER HEREOF AND SUPERSEDE ANY PRIOR AGREEMENTS, WRITTEN OR ORAL, WITH RESPECT
THERETO.

            THERE ARE NO UNWRITTEN ORAL AGREEMENTS AMONG THE PARTIES.

                         [SIGNATURES BEGIN ON NEXT PAGE]

                                       7-

<PAGE>

      EXECUTED effective as of the date first above written.

                        MARINER ENERGY, INC.

                        By: /s/ Rick G. Lester
                            ------------------------------------------------
                                Rick G. Lester
                                Vice President and Chief Financial Officer

                        Mariner LP LLC

                        By: /s/ Rick G. Lester
                            ------------------------------------------------
                                Rick G. Lester
                                Vice President and Chief Financial Officer

                        Mariner Energy Texas LP, a Delaware limited
                        partnership

                          By: Mariner Energy, Inc., its sole general partner

                              By: /s/ Rick G. Lester
                                  ------------------------------------------
                                      Rick G. Lester
                                      Vice President and Chief Financial Officer

                        UNION BANK OF CALIFORNIA, N.A.,
                        as Administrative Agent, as Issuing Lender, and as a
                        Lender

                        By: /s/ Damien Meiburger
                            ------------------------------------------------
                                Damien Meiburger
                                Senior Vice President

                        By: /s/ Randall Osterberg
                            ------------------------------------------------
                        Name:   Randall Osterberg
                        Title:  Senior Vice President

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)

<PAGE>

                                             BNP PARIBAS

                                             By: /s/ David Dodd
                                                 ------------------------------
                                             Name:   David Dodd
                                             Title:  Director

                                             By: /s/ Betsy Jocher
                                                 ------------------------------
                                             Name:   Betsy Jocher
                                             Title:  Vice President

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)

<PAGE>

                                        JPMORGAN CHASE BANK, N.A. (successor by
                                        merger to Bank One, NA)

                                        By: /s/ Jo Linda Papadakis
                                            ------------------------------------
                                        Name:   Jo Linda Papadakis
                                        Title:  Associate Director

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)

<PAGE>

                                     SOUTHWEST BANK OF TEXAS, N.A.

                                     By: /s/ Kenneth R. Batson, III
                                        ---------------------------------------
                                     Name:   Kenneth R. Batson, III
                                     Title:  Vice President

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)

<PAGE>

                                      GUARANTY BANK

                                      By: /s/ Arthur R. Garcia Jr.
                                         -------------------------------------
                                      Name:   Arthur R. Garcia Jr.
                                      Title:  Senior Vice President

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)

<PAGE>

                                       HARRIS NESBITT FINANCING, INC.

                                       By: /s/ James V. Ducote
                                          -----------------------------------
                                       Name:   James V. Ducote
                                       Title:  Vice President

                  Signature Page to Amendment No. 2 and Consent
                             (Mariner Energy, Inc.)