Gold is highly sensitive to U.S. monetary policy, as rising interest rates lift the opportunity cost of holding non-yielding bullion, while boosting the dollar. The metal slid 3 percent last week after hawkish comments from a series of Fed officials.
The Federal Reserve will proceed cautiously with hikes to interest rates, given global risks, Yellen said on Tuesday.
Spot gold rose 1.69 percent to $1,241.56 an ounce, recovering from Monday's one-month low of $1,208.15. U.S. gold futures for April delivery settled up 1.3 percent or up $15.70 an ounce at $1,235.80, and last traded up 1.83 percent at $1,242.40.
Early selling pressure against the dollar helped to buoy gold prices, which extended gains to session highs after the comments. The U.S. dollar index hit an eight-day low on the dovish comments.
Last week's comments from several Fed officials put investors on guard for the possibility of at least two rate increases this year. But the Fed chair's comments on Tuesday raised the possibility of a slower path to rate hikes, traders said.
"It looks like we may be pricing back in just one interest rate hike. That's why we're rallying," said Phillip Streible, senior commodities broker at R.J. O'Brien in Chicago.
San Francisco Federal Reserve President John Williams said on Tuesday the U.S. economy remained on track for a gradual path of interest rate hikes.
A run of soft data has added to uncertainty over the pace of rate increases. The dollar eased to a one-week low against the euro and U.S. Treasury prices hovered near session highs, after figures showing slightly weaker-than-forecast rises in home prices reinforced the view of sluggish economic growth in the first quarter.
Weak data on Monday, which showed U.S. consumer spending barely rose in February and inflation retreated, had already dampened expectations that a rate hike is imminent.
Elsewhere, data showed net gold imports by China, the world's biggest bullion consumer, via main conduit Hong Kong rose in February from a 17-month low hit in the previous month.
In other precious metals, silver futures were up 1.05 percent at $15.35 an ounce, platinum futures were up 2.6 percent at $969.30 an ounce and palladium contracts were up 2.12 percent at $579 an ounce.
— CNBC's Everett Rosenfeld and Gina Francolla contributed to this report.