If they had done their homework, officials at a Brooklyn high school would have quickly discovered that a donor who created havoc with a bogus $1.5 million check is a serial scammer who has served time in prison.

Juan Diaz Romero had a rap sheet dating back almost two decades before he turned up last fall at the HS for Enterprise, Business and Technology in East Williamsburg posing as a Wall Street financier out to do good.

Instead, he created a fiscal mess when the Department of Education advanced funds to the school based on the phony check.

A criminal background check — or diligent search on Google — would have found that Romero, 49, was nabbed for posing as a second-baseman for the Yankees in 1998 after he bought a $38,000 Ford Expedition, also with a bad check. Romero pleaded guilty to filing a forged instrument and was ordered to pay restitution, court records show.

A few years later, Romero surfaced in New York and was charged with a host of crimes, as first reported Friday by DNA and confirmed by The Post.

In 2003, he was charged with filing a false instrument for pretending to be a lawyer in Manhattan Housing Court, police records show.

In 2004, he was twice arrested for swindling money from two different people he convinced to invest in companies and the stock market, making off with $7,000. He was also charged with forgery that year for writing a bad check to a federal credit union.

Twice in 2006, Romero tried to buy cars with bad checks. First he tried drive off in a Range Rover in Manhattan with a fake check for $91,898. A few months later he tried to fraudulently buy two Cadillacs worth $186,000 from the same dealership.

Romero was convicted of criminal possession of a forged instrument in 2007 and spent more than a year in state prison.

It’s not clear how some of the other cases were resolved.

Despite his record, school officials happily accepted Romero.

Special Schools Investigator Richard Condon’s office said Friday it’s investigating whether school and Department of Education staffers violated rules in their dealings with the con man.