Justin Bieber reportedly had a pivotal role in bridging the gap between Kanye West and Kim Kardashian.

Bieber and his wife Hailey visited West at his private ranch in Cody, Wyoming, where West was staying while Kardashian remained with their four children in Los Angeles. The separation came after West publicly asked for a divorce on Twitter.

Kardashian stood by her husband, pointing to his mental health, and West has since apologized publicly for his remarks; however, at the time of Bieber’s visit, West had yet to speak privately to his wife.

RELATED: Kanye West And Crying Kim Kardashian Spotted Together

“Kanye ghosted Kim,” a source reportedly told People. “She tried to reach him for days, but he wouldn’t answer calls and he wouldn’t answer texts.”

“Justin wants to be supportive,” an insider reportedly said. “Justin knows that Kanye has been making new music [in Cody] and appreciates how much pressure it is to produce new music.”

Bieber, 26, is “beyond supportive” when it comes to West, 43, and his mental health issues. “Justin struggled for so long himself before he got proper help,” the insider added.

RELATED: Kanye West Overwhelmed Ahead Of Visit To Hospital, Source Says

“Kanye didn’t want to face Kim,” the source continued. “He doesn’t mind having a public spectacle but he avoids conflict when he’s like this. He knows he disappointed her and that kills him.”

It was allegedly Bieber who “told Kanye that he needed to talk to Kim.” Subsequently, “Kanye finally texted Kim and they talked on the phone.”

Bieber “wants to make sure Kanye is doing well,” the source concluded. “That’s what friends are for.”