Spencer Grammer
Spencer Grammer's husband James Hesketh filed for divorce on Wednesday. Pictured: Grammer attends the HBO Luxury Lounge on Sept. 21, 2013 in Beverly Hills, California. Getty Images/Todd Oren

Spencer Grammer and James Hesketh are ending their marriage legally.

On Wednesday, Hesketh filed for divorce after six years of marriage with the "Rick and Morty" star. In the files obtained by TMZ, Hesketh cited "irreconcilable differences" for the reason of their split. He also asked for joint physical and legal custody for their 6-year-old son, Emmett Emmanual.

The publication noted that Spencer and Hesketh are trying to avoid a messy court battle following their split. Aside from having joint custody for their child, they are also in mediation to resolve all the property issues.

The "Greek" alum married Hesketh in February 2011 at NYC's City Hall. Their wedding happened a day after her dad, Kelsey Grammer, divorced his wife of 13 years, Camille Grammer, Us Weekly reported.

Spencer did not confirm her engagement with Hesketh. But the actress tweeted a month before her wedding with "Thank you to all for my congratulations! I'm very excited."

Back in 2009, the "Graves" actress revealed that her dad gave his approval to all of her relationships. "As long as you don't have a bunch of tattoos he's okay with it. I only date really nice guys," Spencer explained. "He couldn't possibly not like them. I have like really good taste."

Spencer and Hesketh welcomed their baby eight months after their wedding. The "Mr. Robinson" star gave birth to Emmett Emmanual on Oct. 10. The tot is Kelsey's first grandchild, People noted.

Prior to giving birth, Spencer said that her dad is excited about the new addition to their family. "He loves babies. Doesn't everyone love babies?" she said (via Us Weekly). "They have that certain smell and stuff. I think he's very excited about that."

According to Daily Mail, Spencer has just begun her graduate studies at Columbia University in September where she is studying film screenwriting and directing. She is also part of Adult Swim's "Rick and Morty" as Summer Smith.

At the time, the series is on hiatus. "Rick and Morty" Season 4 is expected to return in the summer of 2018 with more episodes.

"The nice healthy way to approach this is I want to prove it with the first 10 of Season 4 — prove it to ourselves, to production, to the network — that it's so easy that we'll earn additional episodes," series creator Dan Harmon said.