A pair of contractors working a job in Queens were busted for waving hundreds of dollars in cash under the nose of a city buildings inspector in a slimy bid to evade construction violations, officials announced Tuesday.

Brooklyn residents Ismail Mohammad Hassan, 22, and Mohamed Ali Hassan, 50, were both slapped with a felony charge of bribery in the third degree Monday after they allegedly were caught red-handed, the city Department of Investigation said.

The DOI launched its probe after an inspector with the Department of Buildings notified the agency he was offered $400 to sweep some violations under the rug at a construction site on Myrtle Avenue in Ridgewood, Queens, on Monday.

The DOI put the inspector under surveillance and had him return to the job site to speak with the suspects.

At that time, Mohamed Hassan took a sum of money from his pocket and handed it to Ismail Hassan, who then placed $290 in the inspector’s hand, according to the DOI.

When the buildings inspector asked where the extra $100 was that had been previously discussed, Mohamed Hassan said if the inspector came back later, they would hand over the rest of the cash, officials said.

“The bribe offer was an unsuccessful effort to evade violations for the failure to obtain the requisite construction permits from DOB and the failure to follow safety protocols that protect tenants during construction renovations,” DOI said.

The contractors were arraigned Monday night in Queens Criminal Court and released on their own recognizance. They face up to seven years in prison.

“This investigation shows how quickly corruption can be stopped when city employees embrace their mandate to report wrongdoing to DOI,” department Commissioner Margaret Garnett said in a statement.

All work has been stopped at the job site near Putnam Avenue until the building’s violations have been addressed, Garnett added.

“I commend this DOB Inspector who stood up for integrity and for all New Yorkers,” said Garnett.

It was not immediately clear whether the Hassans are related.