UNITED STATES
                             SECURITIES AND EXCHANGE COMMISSION
                                   WASHINGTON, D.C. 20549



                                          FORM 10-K


  (Mark one)

  /X/ ANNUAL REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES
      EXCHANGE ACT OF 1934
      For the fiscal year ended December 31, 2004

      OR



  / / TRANSITION REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES
      EXCHANGE ACT OF 1934


      Commission File Number:  333-112231-17


        Merrill Lynch Mortgage Investors, Inc.
        Mortgage Pass-Through Certificates
        Series 2004-D

     (Exact name of registrant as specified in its charter)


   New York                                         54-6636419
  (State or other jurisdiction of                   54-6637657
  incorporation or organization)                    54-6637658
                                                    54-6637659
                                                    54-6637660
                                                    54-6636558
                                                    54-6636559
                                                    54-6636560
                                                    (I.R.S. Employer
                                                    Identification No.)


   c/o Wells Fargo Bank, N.A.
   9062 Old Annapolis Road
   Columbia, Maryland                                21045
  (Address of principal executive offices)     (Zip Code)


  Registrant's telephone number, including area code: (410) 884-2000


  Securities registered pursuant to Section 12(b) of the Act:

        NONE.


  Securities registered pursuant to Section 12(g) of the Act:

        NONE.


  Indicate by check mark whether the registrant (1) has filed all reports
  required to be filed by Section 13 or 15(d) of the Securities Exchange
  Act of 1934 during the preceding 12 months (or for such shorter period
  that the registrant was required to file such reports), and (2) has been
  subject to such filing requirements for the past 90 days.

        Yes  X       No ___


  Indicate by check mark if disclosure of delinquent filers pursuant to
  Item 405 of Regulation S-K ( 229.405 of this chapter) is not contained
  herein, and will not be contained, to the best of registrant's knowledge,
  in definitive proxy or information statements incorporated by reference
  in Part III of this Form 10-K or any amendment to this Form 10-K.

        Not applicable.


  Indicate by check mark whether the registrant is an accelerated filer
  (as defined in Exchange Act Rule 12b-2).

        Yes  ___     No  X


  State the aggregate market value of the voting and non-voting common
  equity held by non-affiliates computed by reference to the price at which
  the common equity was last sold, or the average bid and asked price of
  such common equity, as of the last business day of the registrant's most
  recently completed second fiscal quarter.

        Not applicable.


  Indicate the number of shares outstanding of each of the registrant's
  classes of common stock, as of the latest practicable date.

        Not applicable.


     Documents Incorporated by Reference

  List hereunder the following documents if incorporated by reference and
  the Part of the Form 10-K (e.g. Part I, Part II, etc.) into which the
  document is incorporated: (1)Any annual report to security holders; (2)
  Any proxy or information statement; and (3)Any prospectus filed pursuant
  to Rule 424(b) or (c) under the Securities Act of 1933. The listed
  documents should be clearly described for identification purposes (e.g.
  annual report to security holders for fiscal year ended December 24, 1980).

        Not applicable.


                                   PART I

  Item 1.  Business.

            Omitted.

  Item 2.  Properties.

            See Item 15(a), Exhibits 99.1, 99.2, and 99.3, for information
            provided in lieu of information required by Item 102 of
            Regulation S-K.


  Item 3.  Legal Proceedings.

            The registrant knows of no material pending legal proceedings
            involving the trust created under the Pooling and Servicing
            Agreement (the Trust), the Trustee, the Servicer or the
            registrant with respect to the Trust other than routine
            litigation incidental to the duties of the respective parties.


  Item 4.  Submission of Matters to a Vote of Security Holders.

            None.


                                PART II

  Item 5.  Market for registrant's Common Equity and Related Stockholder
           Matters and Issuer Purchases of Equity Securities.

            No established public trading market for the Certificates exists.

            Records provided to the Trust by the DTC and the Trustee
            indicate that as of December 31, 2004, the total number of holders
            of record for the Series of Certificates is 20.


  Item 6.  Selected Financial Data.

            Omitted.


  Item 7.  Management's Discussion and Analysis of Financial Condition and
           Results of Operation.

            Omitted.


  Item 7A. Quantitative and Qualitative Disclosures about Market Risk.

            Not applicable.


  Item 8.  Financial Statements and Supplementary Data.

            See Item 15(a), Exhibits 99.1, 99.2, 99.3, for information
            provided in lieu of information required by Item 302 of
            Regulation S-K.


  Item 9.  Changes in and Disagreements with Accountants on Accounting and
           Financial Disclosure.

            None.


  Item 9A. Controls and Procedures.

            Not applicable.


  Item 9B. Other Information.

            None.


                                PART III

  Item 10. Directors and Executive Officers of the Registrant.

            Not applicable.


  Item 11. Executive Compensation.

            Not applicable.


  Item 12. Security Ownership of Certain Beneficial Owners and Management.

            Not applicable.

  Item 13. Certain Relationships and Related Transactions.

            Not applicable.


  Item 14. Principal Accounting Fees and Services.

            Not applicable.


                                PART IV

  Item 15. Exhibits, Financial Statement Schedules.

   (a) Exhibits

     (31.1) Rule 13a-14(a)/15d-14(a) Certification

     (99.1) Annual Independent Accountants' Servicing Reports concerning
            servicing activities.

      <TABLE>

      
         <c>
      a) Cendant Mortgage Corp, as Servicer <F1>

      </TABLE>

     (99.2) Report of Management as to Compliance with Minimum Servicing
            Standards.

      <TABLE>

      
        <c>
      a) Cendant Mortgage Corp, as Servicer <F1>

      </TABLE>

     (99.3) Annual Statements of Compliance under the Pooling and Servicing
            Agreements.

      <TABLE>

      
         <c>
      a) Cendant Mortgage Corp, as Servicer <F1>

      </TABLE>


     (99.4) Aggregate Statement of Principal and Interest Distributions to
            Certificate Holders.


   (b) Not applicable.

   (c) Omitted.


  <F1> Filed herewith.


                                SIGNATURES

  Pursuant to the requirements of Section 13 or 15(d) of the Securities
  Exchange Act of 1934, the registrant has duly caused this report to be
  signed on its behalf by the undersigned, thereunto duly authorized:



    Merrill Lynch Mortgage Investors, Inc.
    Mortgage Pass-Through Certificates
    Series 2004-D
    (Registrant)


  Signed: Merrill Lynch Mortgage Investors Inc. as Depositor

  By:     Matthew Whalen, President

  By: /s/ Matthew Whalen, President

  Dated: March 31, 2005


  SUPPLEMENTAL INFORMATION TO BE FURNISHED WITH REPORTS FILED PURSUANT TO
  SECTION 15(d) OF THE ACT BY REGISTRANTS WHICH HAVE NOT REGISTERED
  SECURITIES PURSUANT TO SECTION 12 OF THE ACT.


  (a)(i) No annual report is provided to the Certificateholders other than
  with respect to aggregate principal and interest distributions.


  (a)(ii) No proxy statement, form of proxy or other proxy soliciting
  material has been sent to any Certificateholder with respect to any
  annual or other meeting of Certificateholders.



  Exhibit Index

  Exhibit No.

  Ex-31.1 Rule 13a-14(a)/15d-14(a) Certification

  I, Matthew Whalen, certify that:

  1. I have reviewed this annual report on Form 10-K, and all reports on
     Form 8-K containing distribution or servicing reports filed in
     respect of periods included in the year covered by this annual report
     , of Merrill Lynch Mortgage Investors, Inc. Mortgage Pass-Through
     Certificates, Series 2004-D Trust;

  2. Based on my knowledge, the information in these reports, taken as a
     whole, does not contain any untrue statement of a material fact or
     omit to state a material fact necessary to make the statements made,
     in light of the circumstances under which such statements were made,
     not misleading as of the last day of the period covered by this
     annual report;

  3. Based on my knowledge, the distribution or servicing information
     required to be provided to the Trustee by the Servicer under the
     Pooling and Servicing or similar, agreement, for inclusion in these
     reports is included in these reports;

  4. Based on my knowledge and upon the annual compliance statement
     included in the report and required to be delivered to the trustee in
     accordance with the terms of the pooling and servicing, or similar,
     agreement, and except as disclosed in the reports, the servicer has
     fulfilled its obligations under the servicing agreement; and

  5. The reports disclose all significant deficiencies relating to the
     servicer's compliance with the minimum servicing standards based upon
     the report provided by an independent public accountant, after
     conducting a review in compliance with the Uniform Single Attestation
     Program for Mortgage Bankers or similar procedure, as set forth in
     the pooling and servicing, or similar, agreement, that is included in
     these reports.

     In giving the certifications above, I have reasonably relied on
     information provided to me by the following unaffiliated parties:
     Cendant Mortgage Corp as Servicer, Wells Fargo Bank Minnesota, N.A.
     as Trustee.

     Date: March 31, 2005

     /s/ Matthew Whalen
     Signature

     President
     Title


  EX-99.1
(logo) Deloitte

Deloitte & Touche LLP
750 College Road East
Third Floor
Princeton, NJ 08540
USA

Tel: +1 609 514 3600
www.deloitte.com



REPORT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM


To Cendant Mortgage Corporation:


We have examined Cendant Mortgage Corporation's (the "Company") compliance with
its established minimum servicing standards described in the accompanying
Management's Assertion, dated February 28, 2005, as of and for the year ended
December 31, 2004. Management is responsible for compliance with those minimum
servicing standards. Our responsibility is to express an opinion on the
Company's compliance based on our examination.

Our examination was conducted in accordance with attestation standards
established by the American Institute of Certified Public Accountants as
adopted by the Public Company Accounting Oversight Board and, accordingly,
included examining, on a test basis, evidence about the Company's compliance
with its minimum servicing standards and performing such other procedures as
we considered necessary in the circumstances. We believe that our examination
provides a reasonable basis for our opinion. Our examination does not provide
a legal determination on the Company's compliance with its minimum servicing
standards.

Our examination disclosed the following instance of material noncompliance with
the reconciliation of custodial bank accounts applicable to the Company during
the year ended December 31, 2004. The Company did not comply with the
requirement to prepare custodial bank account reconciliations within 45
calendar days after the cutoff date and the requirement to resolve reconciling
items within 90 calendar days of their original identification as specified by
their minimum servicing standards.

In our opinion, except for the material noncompliance described in the
preceding paragraph, the Company complied, in all material respects, with the
aforementioned minimum servicing standards as of and for the year ended
December 31, 2004, as set forth in Appendix I.


/s/ Deloitte & Touche LLP

February 28, 2005



Member of
Deloitte Touche Tohmatsu




APPENDIX I

MINIMUM SERVICING STANDARDS SET FORTH IN THE MORTGAGE BANKERS
ASSOCIATION OF AMERICA'S UNIFORM SINGLE ATTESTATION PROGRAM FOR
MORTGAGE BANKERS

I. CUSTODIAL BANK ACCOUNTS

1. Reconciliations shall be prepared on a monthly basis for all custodial bank
   accounts and related bank clearing accounts. These reconciliations shall:
    * be mathematically accurate;
    * be prepared within forty-five (45) calendar days after the cutoff date;
    * be reviewed and approved by someone other than the person who prepared
      the reconciliation; and
    * document explanations for reconciling items. These reconciling items
      shall be resolved within ninety (90) calendar days of their original
      identification.

2. Funds of the servicing entity shall be advanced in cases where there is an
   overdraft in an investor's or a mortgagor's account.

3. Each custodial account shall be maintained at a federally insured depository
   institution in trust for the applicable investor.

4. Escrow funds held in trust for a mortgagor shall be returned to the
   mortgagor within thirty (30) calendar days of payoff of the mortgage loan.

II. MORTGAGE PAYMENTS

1.  Mortgage payments shall be deposited into the custodial bank accounts and
    related bank clearing accounts within two business days of receipt.

2.  Mortgage payments made in accordance with the mortgagor's loan documents
    shall be posted to the applicable mortgagor records within two business days
    of receipt.

3.  Mortgage payments shall be allocated to principal, interest, insurance,
    taxes or other escrow items in accordance with the mortgagor's loan
    documents.

4.  Mortgage payments identified as loan payoffs shall be allocated in
    accordance with the mortgagor's loan documents.

III DISBURSEMENTS

1.  Disbursement made via wire transfer on behalf of a mortgagor or investor
    shall be made only by authorized personnel.

2.  Disbursements made on behalf of a mortgagor or investor shall be posted
    within two business days to the mortgagor's or investor's records
    maintained by the servicing entity.

3.  Tax and insurance payments shall be made on or before the penalty or
    insurance policy expiration dates, as indicated on tax bills and insurance
    premium notices, respectively, provided that such support has been received
    by the servicing entity at least thirty (30) calendar days prior to these
    dates.

4.  Any late payment penalties paid in conjunction with the payment of any tax
    bill or insurance premium notice shall be paid from the servicing entity's
    funds and not charged to the mortgagor, unless the late payment was due to
    the mortgagor's error or omission.

5.  Amounts remitted to investors per the servicer's investor reports shall
    agree with cancelled checks, or other form of payment, or custodial bank
    statements.

6.  Unused checks shall be safeguarded so as to prevent unauthorized access.

IV. INVESTOR ACCOUNTING AND REPORTING

1.  The servicing entity's investor reports shall agree with, or reconcile to,
    investors' records on a monthly basis as to the total unpaid principal
    balance and number of loans serviced by the servicing entity.

V.  MORTGAGOR LOAN ACCOUNTING

1.  The servicing entity's mortgage loan records shall agree with, or reconcile
    to, the records of mortgagors with respect to the unpaid principal balance
    on a monthly basis.

2.  Adjustments on ARM loans shall be computed based on the related mortgage
    note and any ARM rider.

3.  Escrow accounts shall be analyzed, in accordance with the mortgagor's loan
    documents, on at least an annual basis.

4.  Interest on escrow accounts shall be paid, or credited, to mortgagors in
    accordance with the applicable state laws. (A compilation of state laws
    relating to the payment of interest on escrow accounts may be obtained
    through the MBA's FAX ON DEMAND service. For more information, contact MBA.)

VI. DELINQUENCIES

1.  Records documenting collection efforts shall be maintained during the
    period a loan is in default and shall be updated at least monthly. Such
    records shall describe the entity's activities in monitoring delinquent
    loans including, for example, phone calls, letters and mortgage payment
    rescheduling plans in cases where the delinquency is deemed temporary
    (e.g., illness or unemployment).

VII. INSURANCE POLICIES

1.   A fidelity bond and errors and omissions policy shall be in effect on the
     servicing entity throughout the reporting period in the amount of coverage
     represented to investors in management's assertion.





  EX-99.2
Cendant Mortgage
3000 Leadenhall Road
Mt. Laurel, NJ 08054

(logo) CENDANT
       Mortgage

February 28, 2005



As of and for the year ended December 31, 2004, Cendant Mortgage Corporation
(the "Company") has complied in all material respects with the minimum servicing
standards set forth in the Mortgage Bankers Association of America's Uniform
Single Attestation Program for Mortgage Bankers, except for as discussed below.

During the year ended December 31, 2004, the Company determined it was
materially non-compliant with the requirement to prepare custodial bank account
reconciliations within 45 calendar days after the cutoff date and the
requirement to identify and resolve reconciling items within 90 calendar days
as specified by the minimum servicing standards.

The Company has undertaken remediation activities to address this material
instance of non-compliance as of December 31, 2004.

As of and for this same period, the Company had in effect a fidelity bond and
errors and omissions policy in the amount of $160 million and $20 million,
respectively.



Cendant Mortgage Corporation

/s/ Terence Edwards
Terence W. Edwards
President and Chief Executive Officer


/s/ Mark Danahy
Mark Danahy
Senior Vice President and Chief Financial Officer


/s/ Martin L. Foster
Martin L. Foster
Senior Vice President - Loan Servicing





  EX-99.3
PHH Mortgage Services

(logo) PHH


Wells Fargo Bank. N.A.
9062 Old Annapolis Rd.
Columbia, MD 21054
Attention: Kim


RE: Annual Statement as to Compliance

Investor number(s)/Deal name(s): as listed on the attached Schedule A

Dear Investor, Master Servicer or Trustee,

The undersigned officer certifies the following for PHH Mortgage Corp. f/k/a
Cendant Mortgage Corp. for the 2004 calendar year. To the best of our knowledge:


a) The activities and performance of the Servicer during the preceding Fiscal
   year under the terms of the above Servicing Agreement, Trust Agreement,
   Pooling and Servicing Agreement and/or Servicer Guide and to the best of my
   knowledge the Servicer has fulfilled all of its duties, responsibilities or
   obligations under this Agreement throughout such year, or if there has been
   default or failure of the Servicer to perform any such duties,
   responsibilities or obligations, a description of each default or failure
   and the nature and status thereof has been reported to Wells Fargo Bank;
b) The Servicer is currently an approved FNMA or FHLMC Servicer in good
   standing:
c) The Fidelity Bond, the Errors and Omissions Insurance Policy and any other
   bonds required under the terms of the Servicing Agreement, Trust Agreement,
   Pooling and Servicing Agreement and/or Servicer Guide are in full force and
   effect;
d) All premiums for each Hazard Insurance Policy, Flood Insurance Policy
   (if applicable) and Primary Mortgage Insurance Policy (if applicable), with
   respect to each Mortgaged Property, have been paid and that such insurance
   policies are in full force and effect;
e) All real estate taxes, governmental assessments and any other expenses
   accrued and due, that if not paid could result in a lien or encumbrance on
   any Mortgage Property, have been paid, or if any such costs or expenses have
   been paid with respect to any Mortgaged Property, the reason for the
   non-payment has been reported to Wells Fargo Bank;
f) All Custodial Accounts have been reconciled and are properly funded; and
g) All annual reports of Foreclosure and Abandonment of Mortgaged Property
   required per section 6050H, 6050J and 6050P of the Internal Revenue Code,
   respectively, have been prepared and filed.


Certified by

/s/ William E. Fricke, Jr.
William E. Fricke, Jr.
Assistant Vice President

3/15/05
Date:




PHH Mortgage Services

(logo) PHH

SCHEDULE A

BAY     2004-C          MARM    2004-3          THB     2004-1
BAY     2004-D          MARM    2004-4          THB     2004-2
BSA     2003-AC7        MARM    2004-5          WFMBS   2004-1
BSA     2004-AC1        MASTR   2003-10
BSA     2004-AC2        MASTR   2003-11
BSA     2004-AC4        MASTR   2003-12
BSA     2004-AC5        MASTR   2003-7
BSA     2004-AC6        MASTR   2003-8
BSL     2003-7          MASTR   2003-9
BSL     2004-12         MASTR   2004-1
BSL     2004-3          MASTR   2004-10
BSL     2004-4          MASTR   2004-11
BSL     2004-6          MASTR   2004-3
BST     2003-9          MASTR   2004-4
BST     2004-1          MASTR   2004-5
BST     2004-10         MASTR   2004-6
BST     2004-12         MASTR   2004-8
CSF     2004-1          MASTR   2004-9
CSF     2004-AR1        MLC     2004-1
CSF     2004-AR2        MLC     2004-A
HBV     2004-10         MLC     2004-B
JPMMT   2004-Al         MLC     2004-C
JPMMT   2004-A2         MLC     2004-D
JPMMT   2004-A3         MLC     2004-E
JPMMT   2004-A4         MLC     2004-F
JPMMT   2004-A5         MLC     2004-G
JPMMT   2004-A6         MLC     2004-HB1
JPMMT   2004-S2         MLM     2004-A01
MAL     2004-1          MSML    2004-10AR
MAL     2004-10         MSML    2004-11A
MAL     2004-11         MSML    2004-2AR
MAL     2004-12         MSML    2004-3
MAL     2004-13         MSML    2004-4
MAL     2004-3          MSML    2004-5AR
MAL     2004-4          MSML    2004-6AR
MAL     2004-5          MSML    2004-7AR
MAL     2004-6          MSML    2004-8AR
MAL     2004-7          MSML    2004-9
MAL     2004-8          MSSTA   2004-1
MAL     2004-9          PAM     2004-CL1
MARM    2004-1          PRM     2004-CL2
MARM    2004-10         SAIL    2004-7
MARM    2004-11         SAM     2004-AR1
MARM    2004-15         THB     2003-2
MARM    2004-2          THB     2003-5





  Ex-99.4

   Schedule of Year-To-Date Principal and Interest Distributions to
   Certificateholders


   <TABLE>

   Class                              Interest             Principal               Losses             Ending Balance
   
                       <c>                    <c>                  <c>                 <c>
   A-1                            2,757,843.95          9,196,020.01                 0.00             367,933,979.99
   A-2                            3,897,298.06         22,355,639.07                 0.00             487,514,360.93
   A-3                              887,774.84          4,167,973.67                 0.00              78,332,026.33
   A-R                                    2.74                100.00                 0.00                       0.00
   B-1                               79,883.34                  0.00                 0.00              10,000,000.00
   B-2                               75,277.78                  0.00                 0.00               8,000,000.00
   B-3                               51,896.37                  0.00                 0.00               4,500,000.00
   B-4                               27,019.12                  0.00                 0.00               2,500,000.00
   B-5                               21,615.31                  0.00                 0.00               2,000,000.00
   B-6                               37,840.38                  0.00                 0.00               3,501,258.00
   X-A                            2,828,929.51                  0.00                 0.00             855,448,340.92
   X-B                               36,114.68                  0.00                 0.00              22,500,000.00
   </TABLE>