Bristol Palin and former fiance Levi Johnston have agreed to share custody of their son Tripp following a protracted legal battle.
"I'm so happy to have my son in my life, and to put all of this back in forth in the courts behind me," Johnston wrote.
"It might have taken me 7 years and cost me around $100,000 in lawyer fees, spread out among 3 different lawyers, as well as a lot of patience, but it was all worth it."
Palin and Johnston were high school sweethearts who called off their engagement in 2009.
The pair previously agreed that Johnston would see Tripp two days a week, but this was never approved in court and was dismissed in 2012.Johnston filed for equal custody in 2013.
"Despite what some have heard I've always been there for him, and I go to almost every school event that I can and spend all of my free time with my kids. Right now life is really looking up for our family," Johnston added of himself and wife Sunny Oglesby.
Palin has yet to address the agreement, but did quote Jane Blaustone on Instagram, writing, "The best security blanket a child can have is parents who respect each other."
Palin is the daughter of Todd Palin and former Alaska governor Sarah Palin and also mom to 2-month-old daughter Sailor.
The infant's father, Palin's ex-fiance Dakota Meyer, filed for child support and joint custody of Sailor in January.