Alan Greenspan is sounding the alarm about the booming stock market.

"There are two bubbles: We have a stock market bubble, and we have a bond market bubble," the former Federal Reserve chairman told Bloomberg TV on Wednesday.

The trouble in the bond market "will eventually be the critical issue," Greenspan said, adding that "for the short term it's not too bad."

Many Americans recall that Greenspan, known as the Maestro when he led the Fed, described the dotcom mania of the 1990s as "irrational exuberance." That memorable phrase, from late 1996, ended up being right -- albeit several years early. The Nasdaq didn't peak until March 2000.

Greenspan, who was appointed Fed chair by both Republican and Democratic presidents, raised doubt in the interview about President Trump's economic agenda.

"I was very much surprised that in the State of the Union all those new initiatives were not funded," Greenspan told Bloomberg.

Trump's tax overhaul is expected to add to the federal deficit, something Greenspan has previously called a "mistake." Trump's plan to ramp up infrastructure spending could do the same. He has not detailed how he plans to pay for it.

Asked what happened to the "frugality and prudence of the GOP," Greenspan replied: "Good question. If you find out let me know."

The worry is that the government spending, from new programs and existing social safety nets, will blow a hole in the budget. That could cause interest rates to rise rapidly, speeding up inflation.

"We are dealing with a fiscally unstable long-term outlook in which inflation will take hold," Greenspan said. "We're working our way towards stagflation."

Greenspan's skepticism of the bond market isn't new -- or surprising. Last July he said that bonds, but not stocks, were in a bubble.

Bond prices have cooled since then, but the stock market has kept heating up. The Dow has zoomed another 4,000 points since mid-summer. Stocks retreated a bit this week: The Dow suffered its worst two-day percentage drop since September 2016.

Related: Turbulence returns to the stock market

There are valid reasons for stocks to be booming. The U.S economy is healthy, and the global economy is growing even faster. Corporate profits have never been higher -- and they're getting a big boost from the tax cut for businesses.

The relentless rally has led some analysts to warn that the markets are in a "melt-up," a rapid rise in prices based on emotion, not fundamentals.

Greenspan is going a step further by calling the market an outright bubble. The Dow has surged 44% since Trump's election.

Most market strategists acknowledge high levels of optimism, but not exuberance.

"I don't see big bubbles," said David Kelly, chief global strategist at JPMorgan Funds. "I see small bubbles, but on a rising tide of enthusiasm."

Kelly said there is no "obvious bubble like tech stocks in 1999 and the housing bubble in 2007."

The overheated housing market last decade laid the groundwork for the 2008 financial crisis, the worst since the Great Depression.

The Federal Reserve has been criticized for helping to inflate the housing bubble by keeping interest rates too low. The leader of the Fed at the time? Alan Greenspan.