It’s a real-life tale of “Prince and the Pauper” – except in this case it was accidental.

A Japanese man born to rich parents grew up in poverty after he was accidentally switched at birth — while the man who took his place lived an affluent life, eventually becoming a successful real estate honcho, The Telegraph reports.

The 60-year-old man, who was yanked from his wealthy parents in a hospital as a baby, grew up in a one-bedroom apartment, surviving on state hand-outs and working in a factory after his thought-to-be father died when he was only 2-years-old, the paper reports.

At the same time, the man who took his place — who was born 13 minutes after at San-Ikukai Hospital in Tokyo– lived a privileged life, complete with a personal tutor and a college education that helped him become the head of a well-known real estate firm.

Their true identities were revealed after the brothers of the man given to the wealthy family urged him to take a DNA test in 2011, saying he looked nothing like the rest of the family.

They then requested hospital records and both families soon discovered the switch at birth had happened after a midwife, who was bathing both babies, returned them to the wrong mothers.

“I might have had a different life…I want [the hospital] to roll back the clock to the day that I was born,” the man who grew up poor, who recently took the hospital to court, told media in Toyko.

On Tuesday, The Tokyo District Court ordered the hospital to pay the man 38 million yen, or roughly $370,000 — much less than the $2 million he had demanded.

“There were far-reaching differences between the two family environments and the plaintiff suffered an unreasonable loss as a result,” a judged said in a ruling.

The man who grew up poor is now pursuing a relationship with his wealthy biological brothers.

“I wondered how on earth this could have happened. I could not believe it. To be honest, I did not want to accept it,” he said.