'Grey's Anatomy' season 12 spoilers: Callie and Arizona go head to head over custody of Sofia

Meredith Grey (Ellen Pompeo) in Grey's Anatomy season 12ABC

"Grey's Anatomy" season 12 episode 22, titled "Mama Tried," will see Dr. Callie Torres (Sara Ramirez) and her ex-wife Dr. Arizona Robbins (Jessica Capshaw) go head to head in court as they attempt to settle the issue of who gets to keep custody over their child Sofia (Eva Ariel Binder).

A report from the IBTimes reiterates the Biblical story where two women approached King Solomon regarding custody of a child, as narrated by series main character Meredith Grey (Ellen Pompeo).

It is speculated that this is a hint that whoever relinquishes custody may be the one that the court chooses to grant custody as this is a sign that the mother would be willing to sacrifice their own time with their child to ensure Sofia is not harmed in the conflict of her mothers.

Actor Kevin McKidd, who plays Dr. Owen Hunt in the series, directed this episode, and in an interview with TVLine he explained that this episode will have a vibe of the earlier seasons of "Grey's Anatomy." He also stated that all of the characters will have to give a testimony and things will get difficult when Dr. Penelope Blake aka Penny (Samantha Sloyan) gives hers.

"It really puts Callie and Penny's relationship to the test when Penny testifies, and affects their relationship going forward in a big way. The testimony that Penny gives... she does her best for Callie, but it doesn't go as planned, and that causes problems," McKidd teased without spoiling how or why Penny's testimony goes awry.

McKidd also confirmed that there is a moment in the episode where Callie and Arizona do try to settle this calmly and out of court but then the lawyers interrupt and start arguing on legal terms and this causes the ex-wives to start fighting again, making it difficult for either of them to move forward without taking the issue to court.

"Grey's Anatomy" season 12 episode 22 will air this May 5.