This is literally a rags-to-riches tale.

A homeless man who wandered the streets of Utah has inherited a “significant” amount of money from a brother in New York who died more than a year ago.

Max Melitzer, 65, was told the stunning news Saturday after a private investigator hired by his family found him on a Salt Lake City park bench.

“He’ll no longer be living on the street or in abandoned storage sheds,” said the investigator, David Lundberg.

“He’s still in shock. This came out of nowhere.”

Melitzer’s brother, Morris, lived in Schenectady and died of cancer in April 2010.

Morris, who worked for General Electric, left the money for his brother, but other family members were unable to track down Max.

Lundberg was hired about two months to locate Max and let him know about the inheritance.

He wouldn’t say yesterday how much money Max was set to gain except to call it “significant.” [AP] by Tim Perone