Men in Black Agent  WILL SMITH has taken out-of-control JUSTIN BIEBER under his wing – and he even ac­companied the young heartthrob on parts of his interna­tional tour to keep him in line.

The “Baby” singer has been on a downward spiral since breaking up with Disney starlet girlfriend, Selena Gomez, in late December, and his an­tics have his mom Pattie Mallette so worried, she’s reached out to “Men in Black” star Will for help, say sources.

“PATTIE HAS BEEN STRUGGLING TO figure out what’s the best course of action, and she realized that Will could be just what the doctor or­dered,” said a source. “Justin and Will’s son Jaden are close friends, and he was with both of them in London in March, when Jaden was the open­ing act for some of Justin’s shows.

“Will started making Justin ad­here to a strict curfew and limited his computer and TV time. Will also makes sure he doesn’t stay out too late and that he steers clear of shady characters and overaggressive groupies.

“Will works out with Justin, gives him a reading list of inspirational books and encourages the kid to keep a ‘vision board,’ where he can keep postings of his short-and long-term goals. And Justin already seems to have more focus.”

As The ENQUIRER recently re­ported, Pattie is afraid that her multiplatinum-selling son could be headed to rehab. In January, photos surfaced of Justin allegedly smok­ing pot with rapper pal Lil Twist. And as we exclusively reported in January, Jus­tin cheated on then-galpal Selena with a Memphis teen who claimed she did the designer drug Ecstasy to make herself feel sexy.

Also, in early March, Justin showed up two hours late for a concert, was hospitalized on March 7 due to breathing difficulties and went ballis­tic on a photographer soon after.

Pattie’s worst fear is that Justin, 19, will wind up like his dad, Jeremy, who was a boozing, brawl­ing drug user and walked away from his family when Justin was a baby, according to an insider.

It seemed like Will’s influence was having a pos­itive effect when Justin tweeted his thanks to the actor on March 10 for giving him a “great talk.”

But on March 18, Justin was reportedly kicked out of the Hotel Le Meurice in Paris. Al­though the hotel denied he was asked to leave, sources say he was bounced due to his attitude and the nuisance created by some of his fans.

“Justin’s getting the idea, but Will still has his work cut out for him,” said the source.

Justin has been close to the Smith family for a while. Jaden, 14, was featured on his pal’s 2011 song “Never Say Never,” and Will, 44, is helping the pop singer transition into acting.

“Will even suggested to Justin that when his tour is over, he should come live at the Smith family’s L.A. com­pound for a few weeks,” the source added. “Justin’s mom is so grateful to Will for getting her son to shape up.”