Just when he thought he was out …

The son of reputed Colombo crime family capo Joseph Amato Sr. was granted $1 million bail Friday morning after spending a night in jail as part of Thursday’s 20-defendant mob takedown — but freedom was fleeting.

Before Joseph Amato Jr. could even leave the courtroom and change out of his tan jail scrubs, a federal prosecutor protested the bail, arguing that the mob scion should stay jailed because he’s too fond of dropping his infamous father’s name around town.

“He understands that, on Staten Island, his father has a certain reputation for violence,” Assistant US Attorney Elizabeth Geddes told a federal magistrate judge. “And he uses it.”

Geddes cited Jr.’s alleged role in the 2014 beatdown of a victim who’d made the mistake of saying he didn’t know who Joseph Amato Sr. was — and who afterward needed staples to close wounds to his head.

“It’s talk,” countered Jr.’s lawyer, James Froccaro, Jr. “We’re not going to start remanding people because of talk alone?”

But now, Jr. must stay in jail at least through the weekend — without bail — until the matter can be reviewed by a higher authority, Brooklyn Federal Judge Leo Glasser.

He’s the same tough judge who presided over John Gotti Sr.’s 1992 murder conviction — and sentenced him to life.