4:04 PM PT -- Bam is en route to a rehab facility after a 3 hour session with Dr. Phil helped him see he needed professional help ... TMZ has learned.
Sources with direct knowledge of the conversation tell us it was a very emotional sit down, with Bam tearing up several times. We're told things came to a "boiling point" when Bam's wife, Nikki, joined Dr. Phil. Bam confronted Nikki about what he considers her "extreme stubbornness" ... according to our sources.
We're told Bam's mother also participated in the session -- and she and Nikki asked Phil for help identifying what kind of substances Bam was abusing.
Bam's now on his way to begin what we're told will be a 60-90 day stay in treatment.
Bam Margera's public plea for help from Dr. Phil worked -- TMZ has learned they're on set right now getting ready for a one-on-one session ... then it might be off to rehab.
Our Dr. Phil sources say the good doc has agreed to meet with Bam and tackle his issues head-on -- just the 2 of them -- with no studio audience. It's being shot in the green room.
Based on what we know, it's likely the "Jackass" star will be urged on to a rehab facility afterward to get his life in order.
Waiting for your permission to load the Instagram Media.
Bam just posted that he's on the Paramount lot -- where the show films -- getting ready ... and hanging out with his old buddy, Johnny Knoxville.
As we reported ... Margera shared a series of concerning videos on social media Sunday practically begging for Dr. Phil to take his situation on and help him with his ongoing struggles. Bam said he's worse than he's ever been and his "family is in shambles."