Leah Messer got dealt a devastating blow in her ongoing custody battle with her first ex-husband Corey Simms. Their legal battle over their 6-year-old twin daughters Aliannah Hope and Aleeah Grace has been a running storyline on MTV's hit reality TV series "Teen Mom 2." On this week's episode, Simms's lawyer announces that a judge awarded him primary custody of their girls, and Messer reacts to the heartbreaking news in a new sneak peek.

Last season, Simms brought a case against Messer and her parenting skills. He blamed her for Ali and Aleeah's tardiness and absences from school and claimed that she was not providing a stable home environment for their daughters. In a clip from next week's episode, Messer arrives at her lawyer Lyne Ranson's office to go over the judge's order.

"I wanted to go over the order that we got with you," Ranson tells Messer as they sit down with copies of the new court decision. "There are certain things about it that I don't think are right. The custodial parent, the judge said the custodial responsibility had been flipped to the father."

Messer nods silently and looks at Ranson with wide eyes, then looks down at the paperwork as she purses her lips.

"The judge, he tried to basically say his goal was to make sure that the kids got to school on time," Ranson continues. "The schedule of having the girls on the weekends for you, and him [Simms] having them on Monday, Tuesday, Wednesday. The order gives you that weekend schedule-every Friday, Saturday, Sunday and bring them back to school on Monday."

"'Cause you're so involved with the gymnastics, and that was Thursday night..." Ranson explains.

"Right," Messer says, her voice choking up.

"The judge said yes, you can take them to cheering, to gymnastics, but you would just bring them back to him [Simms]," Ranson says.

Since the verdict was announced on a Tuesday, Ranson says that Simms could take the girls and their new custody agreement will begin immediately.

"You need to take some time to digest this and I've already started a motion to reconsider," Ranson tells Messer before giving her some advice. "Here's what I always tell everybody, Leah. It's your and his life-it's better if the two of you could come to some agreement than lawyers fussing and fighting or a judge making a decision."

Watch the full sneak peek below, and be sure to catch next week's episode of "Teen Mom 2," airing on Mondays at 10 p.m. on MTV.