Justin Bieber helped his mother record her first song.

The “Heartbreaker” hitmaker spent some quality time with Pattie Mallette, whom he had allegedly been avoiding after being arrested in Miami last month, in a recording studio in Atlanta, Georgia, on Thursday night, after writing her some lyrics.

The 37-year-old author was clearly thrilled to have a chance to bond with her famous son, as she wrote on Twitter: "That was the BEST night of my life @justinbieber you were SO sweet to me & I had so much fun #ILoveYou."

She later added: "Amazing night recording my first song. Thank you so much for writing it love!"

The 19-year-old star also shared a picture of Pattie in the studio on Instagram, with the caption: "Got my moms courage enough to get in the booth for the first time she sounds so good."

He later posted a snapshot of the two of them hugging and wrote: "What did I do mom, love you."

Friends recently revealed that Pattie was "genuinely concerned" for Justin's welfare but is determined to stand by the troubled star, despite his recent behaviour -- including being arrested for driving under the influence, driving with an expired licence and resisting arrest.

The insider said: "As any caring mother would be, Pattie is genuinely concerned for Justin, and she has said in many interviews before that she doesn't have her head in the clouds and keeps in very close touch.

"She talks with him almost every day, which is likely more than any mom and a 19-year-old son ... and she is in the public eye dealing with all of this."