Federal Reserve Chair Janet Yellen has no choice but to endure allegations that her reluctance to raise interest rates has been politically motivated, former Fed chief Alan Greenspan told CNBC on Thursday.

Greenspan said on "Squawk Alley" that she just has to "grin and bear it," referring to Donald Trump's claim that Yellen is the most political person in Washington. "That's the only way you can do it."

The GOP presidential nominee has said the central bank has kept rates steady since December's first hike in more than nine years to protect the economic legacy of President Barack Obama and help Democratic nominee Hillary Clinton to slide into the White House.

"I have great sympathy for [Yellen]," Greenspan said "I've been through that routine for a long time."



The Fed would probably prefer not to raise interest rates in an election year, but if the economic numbers dictate it, policymakers would take action, Greenspan said from the sidelines of the International Monetary Fund-World Bank meeting in Washington.

"The real question essentially is would the Federal Reserve hold back when it should be moving, I would say, no," Greenspan said. He was speaking hypothetically, and did not say whether it was indeed time to raise rates.

