The buyers of a Brooklyn building got a most unwelcome gift with their purchase: the former owner’s son, who refuses to leave, a Manhattan Supreme Court lawsuit says.

Silvershore Properties 13 claims that it plunked down $1.3 million for the Boerum Hill walk-up in April on the condition that one of building’s eight units would be vacant.

But a day after closing on the Dean Street building, Silvershore found seller Mohamed Almontaser’s son living in the apartment. Anwar Almontaser, 32, said he has lived there since 2001 and has a lease.