'Gotham's' Morena Baccarin Faces Her Ex in Court as Pregnancy News Surfaces

This video is unavailable because we were unable to load a message from our sponsors.

If you are using ad-blocking software, please disable it and reload the page.

As Gotham co-stars Morena Baccarin and Ben McKenzie happily confirmed news that they are expecting a baby together, the 36-year-old actress faced off with her ex in court on Thursday.

Morena's husband of three and a half years, Austin Chick, filed for divorce on June 12 citing irreconcilable differences. Together, the former couple shares a son, Julius, who turns 2 in October.

The pair met in court in Los Angeles on Thursday to settle the matter of Julius' custody. Baccarin had filed for full legal custody of her son since Chick is based in Los Angeles and she lives in New York, revealing that she would no longer be able to fly back and forth due to her pregnancy.

WATCH: Ben McKenzie and Morena Baccarin Are Expecting a Baby Together!

Wearing a baggy pink blouse, black trousers and colorful sandals, Baccarin showed no sign of a baby bump, but appeared visibly upset during the hearing and could be seen rolling her eyes. Her estranged husband, meanwhile, nonchalantly toyed with a piece of paper during the proceedings.

Ultimately, the judge ordered joint legal custody with the child temporarily based in New York with Baccarin until she finds out whether Gotham will be renewed for a third season by Fox. In the meantime, the actress will also pay for travel and a New York apartment for Chick during his visits. Chick is also entitled to take the child back to Los Angeles every two months for one week at a time, given he provides written notice 15 days in advance.

The ruling will go into effect in 30 days.

WATCH: The 11 Biggest Celebrity Splits of 2015's Summer of Heartbreak

Baccarin's lawyer said that her client is having a difficult pregnancy so far, and in just a few months will not be able to fly to Los Angeles. She's "also in a new relationship and is moving on with her life," the attorney stated.

Following the ruling, Chick exited the court quickly with Baccarin chasing after him to ask about his plan for their son that night. Chick appeared to give a short response before leaving, while Baccarin turned to the woman she arrived with for a tearful, emotional hug.

Getty Images

The former couple's last public sighting together was at the GLSEN Respect Awards in L.A. on Oct. 17 of last year.

NEWS: Morena Baccarin and Ben McKenzie Step Out on Emmys Weekend!

Meanwhile, McKenzie's sister Camille Schenkkan is welcoming Baccarin into their family with open arms, tweeting on Thursday, "Welcome to the family, Morena! Also... I'M GONNA BE AN AUNT."

The 37-year-old McKenzie sweetly retweeted the post, but has yet to speak publicly about the pregnancy news.

Baccarin joined Gotham in late 2014 and her character, Dr. Leslie Thompkins, became romantically involved with McKenzie's Jim Gordon at the end of the show's first season. Interestingly enough, this isn't the first time the two have worked together. She also made a one-episode appearance on The O.C. in 2006, the Fox hit that made McKenzie a star.

Gotham returned to Fox for its second season on Monday, Sept. 21.