(Reuters) - The Dow ended above 29,000 for the first time on Wednesday and the S&P 500 also closed at a record high after the United States and China signed a Phase 1 trade agreement and pledged to resolve a tariff dispute that has roiled Wall Street for over a year.

The centerpiece of the truce is a pledge by China to purchase at least an additional $200 billion worth of U.S. farm products and other goods and services over two years, over a baseline of $186 billion in purchases in 2017.

The trade agreement clears the way for investors to focus on upcoming quarterly earnings reports, including the outlooks companies provide in light of the deal.

“There’s no question from a psychological viewpoint it’s a big relief for the market,” said Peter Cardillo, chief market economist at Spartan Capital Securities in New York. “There are still CEOs that are dubious, but this might help capital investments, and that was the biggest missing link to the economy over the last few years.”

Trump said he would remove all U.S. tariffs on Chinese imports as soon as the two countries complete a Phase 2 trade agreement, on which negotiations will start soon.

“I am sure as people dissect (the agreement), there is going to be criticism of it - it’s not doing enough, or it’s not doing this, or whatever. But the market, had it not gotten signed ... would have reacted negatively,” said Chuck Carlson, chief executive of Horizon Investment Services in Hammond, Indiana.

The three main stock indexes gave up earlier intraday record highs, with disappointing earnings reports from Bank of America pushing the S&P financial index .SPSY down 0.55%.

Bank of America Corp BAC.N reported a better-than-expected quarterly profit, but warned of weak net interest income in the first half of 2020, knocking its shares down 1.8%.

Goldman Sachs Group Inc GS.N slipped 0.2% after reporting a bigger-than-expected fall in profit as it set aside more money to cover legal costs.

The Dow Jones Industrial Average .DJI rose 0.31% to 29,030.22 points, ending above 29,000 for the first time.

The S&P 500 .SPX gained 0.19% to 3,289.3, its highest ever close.

The Nasdaq Composite .IXIC added 0.08% to 9,258.70, just short of its record high close set on Monday.

UnitedHealth Group Inc UNH.N, the largest U.S. health insurer, rose 2.8% as it affirmed its full-year outlook for 2020 adjusted earnings. The S&P healthcare index .SPXHC climbed 1.0%.

Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., January 15, 2020. REUTERS/Brendan McDermid

Retailer Target Corp TGT.N slumped 6.6% after it missed its own expectations for 2019 holiday season sales after reporting a drop in online growth and demand for toys and electronics.

Toymakers Mattel Inc MAT.O and Hasbro Inc HAS.O fell 4.6% and 2.1%, respectively, while electronics seller Best Buy BBY.N dropped 1.7%.

Advancing issues outnumbered declining ones on the NYSE by a 1.35-to-1 ratio; on Nasdaq, a 1.31-to-1 ratio favored advancers.

The S&P 500 posted 74 new 52-week highs and no new lows; the Nasdaq Composite recorded 151 new highs and 20 new lows.

Volume on U.S. exchanges was 7.3 billion shares, compared with an average of 7.0 billion shares over the last 20 trading days.