JUST HOURS before heading off to rehab, Backstreet Boy A.J. McLean partied up a storm in a final booze-soaked blowout at a posh Boston hotel.

The ENQUIRER learned that following the group’s July 7 performance A.J. went without his band mates to see the street-racing flick “The Fast and the Furious” — and when he returned to his hotel after midnight, he roared into high gear.

“A.J. came back to the Ritz-Carlton hotel bar to party hearty,” an eyewitness told The ENQUIRER.

“He sat at a piano, girls flanking him on both sides. Everybody was consuming alcohol. The piano had four or five cocktails on top of it, and as A.J. played and sang he kept drinking.

“As it neared 2 a.m., A.J.’s bodyguard said, ‘It’s getting late so let’s wrap this up.’ A.J. pointed his finger at the bodyguard and snapped, ‘Don’t bother me!’ “

When he finally tired of partying about 2:30 a.m., the singer headed for the elevator with three women in tow.

A.J. was scheduled to appear with the group just hours later at Fenway Park to throw out the first pitch at a baseball game, so the concerned bodyguard tried to convince him to leave without the women and call it a night.

“But A.J. pushed the bodyguard away, brought the three girls into the elevator and wouldn’t let the bodyguard or anyone else get in,” said the eyewitness.

“A short while later, the women who had gone with A.J. came back down and said, ‘There was a fight, there was a fight!’ One said there was an altercation among the Backstreet Boys.

“The girl said the bodyguard went and got the rest of the band and they banged on A.J.’s door and told him to come out. That’s when the fight happened.”

A.J. McLean’s nickname is Bone.

Signs of trouble among the Backstreet Boys were clearly evident as four of the five band mates went onto the field at Fenway Park — without A.J.

The following day the band appeared on national TV and announced that A.J. had entered rehab for “depression, anxiety and his excessive consumption of alcohol.”

Sadly, what went on in Boston was typical of the troubled entertainer’s wild lifestyle, a friend told The ENQUIRER.

“A.J. won’t let anyone break up a party before he’s ready — usually about 5 or 6 a.m.

“He’s had parties at his house in Orlando where he’s invited total strangers. He’d fall asleep and these people would trash the place while he was out cold.”