Exhibit 10.4

AMENDMENT NO. 2

TO THE

ADVISORY AGREEMENT

This amendment no. 2 to the Advisory Agreement dated as of November 8, 2009 (the
“Advisory Agreement”) between KBS Real Estate Investment Trust, Inc., a Maryland
corporation (the “Company”), and KBS Capital Advisors LLC, a Delaware limited
liability company (the “Advisor”), is entered as of January 15, 2010 (the
“Amendment”). Capitalized terms used herein but not defined shall have the
meaning set forth in the Advisory Agreement.

WHEREAS, upon the terms set forth in this Amendment, the Advisor has agreed to
amend and restate Article 16 of the Advisory Agreement and advance funds to the
Company upon the terms set forth below.

NOW, THEREFORE, in consideration of the foregoing and of the mutual covenants
and agreements contained herein, the parties hereto agree that Article 16 of the
Advisory Agreement is hereby amended and restated in its entirety as follows:

ADVANCE

Notwithstanding anything contained in Article 9 of this Agreement to the
contrary, the Advisor hereby agrees to advance funds (the “Advance”) to the
Company equal to the amount by which the cumulative amount of distributions
declared by the Company from January 1, 2006 through the period ending March 31,
2010 exceeds the amount of the Company’s Funds from Operations from January 1,
2006 through March 31, 2010. Advisor further agrees that the Company will only
be obligated to reimburse the Advisor for the Advance if and to the extent that
the Company’s cumulative Funds from Operations for the period commencing
January 1, 2006 through the date of any such reimbursement exceeds the lesser of
(i) the cumulative amount of any distributions declared and payable to the
Company’s Stockholders as of the date of such reimbursement or (ii) an amount
that is equal to a 7.0% cumulative, non-compounded, annual return on Invested
Capital for the Company’s Stockholders for the period from July 18, 2006 through
the date of such reimbursement. Advisor understands and agrees that no interest
shall accrue on the Advance being made under this Agreement.

Signature page follows.

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

IN WITNESS WHEREOF, the parties hereto have executed this Amendment as of the
date and year first above written.

 

KBS REAL ESTATE INVESTMENT TRUST, INC. BY:   /s/ Charles J. Schreiber, Jr.  
Charles J. Schreiber, Jr., Chief Executive Officer

 

KBS CAPITAL ADVISORS LLC BY:   Schreiber Real Estate Investments, L.P., a
Manager

 

BY:   Schreiber Investments, LLC, as general partner

 

BY:   /s/ Charles J. Schreiber, Jr.   Charles J. Schreiber, Jr., Manager