PAINKILLER-ADDICTED Matthew Perry has a new battle on his hands and it’s not drugs or booze — it’s his “Friends.”

The 31-year-old star convinced doctors to temporarily spring him from drug-and-alcohol rehab so he could shoot his show’s season-ending finale. But the still-recovering star got the cold shoulder from fed-up co-stars David Schwimmer and Lisa Kudrow.

Returning to the set required a major effort by Perry — who was accompanied by security guards to keep him on the straight and narrow and make sure he returned to the Daniel Freeman Marina Hospital in Marina Del Rey, Calif., disclosed a pal.

“He was watched every minute. No one could afford for him to go missing.”

Revealed an insider: “Matt’s still not close to being 100 percent. But he pulled himself together for the finale in which his character marries Courteney Cox.

“It was incredibly disappointing for Matt his first day back, March 20. He got warm hugs and kisses from Courteney Cox, Jennifer Aniston and close pal Matt LeBlanc. But he got the chilliest reception possible from David Schwimmer and Lisa Kudrow.

“David and Lisa feel sorry for Matt. But they are at the point where they feel like he’s left them in the lurch and affected their livelihoods.”

Matthew Perry’s dad John played Matt’s on-camera dad Richard in the 1997 film “Fools Rush In.”

The troubled actor, who’s been in rehab once before, is making progress, say sources.

But his father, actor John Perry, believes Matt has a long way to go, confides the pal.

“John now believes the best thing for Matt is to remain in rehab until August. He doesn’t want him to slip again.”

Matt had to convince his father it was safe to leave rehab for a few days, revealed his pal. “Matt completed the rough detox period, but is still in physical pain from his drug abuse.”

Trying to make a fresh start, the star, who plays Chandler Bing, has also been attending Alcoholics Anonymous meetings. A source who attended one session revealed, “Matt was skinny and white as a ghost.”

The actor was wearing thick black-frame glasses and a baseball hat.

“Beforehand he took time to greet some pals, but once the meeting started, he kicked into serious mode and hardly made a peep,” said the source.

Matt doesn’t blame co-stars David and Lisa for their painful snub, divulged the insider.

“He apologized separately to each of them, and he’ll probably be apologizing for a long time to come. They heard him out, but really just paid lip service. Privately they were critical of him and indicated they’d lost patience and faith in Matt as a co-star.

“But Matt is once again trying to earn his fellow actors’ respect. He knows it won’t be easy.”

Added a friend: “Matt is making headway. With each day he’s getting better and healthier. He’s doing everything his doctors advise. People should give him a break.”