Los Angeles, California (CNN) -- Former TV chef Juan-Carlos Cruz faces nine years in prison after pleading "no contest" Tuesday to a charge of soliciting two homeless men to kill his wife, the prosecutor said.
The former host of the Food Network's "Calorie Commando" will be sentenced on December 13, but the plea agreement calls for a nine-year sentence, the Los Angeles County District Attorney's Office said.
One count of attempted murder was dropped as part of the plea settlement, the prosecutor said.
The plea came just before his preliminary hearing was to begin before Los Angeles County Superior Court Judge H. Chester Horn.
Fertility issues were at the center of Cruz's motivation in the murder-for-hire plot to kill his wife, according to sources close to the couple.
Two sources close the couple, who asked not to be identified because of the sensitivity of the matter, said their 20-year struggle to have a child overwhelmed them.
After spending a lot of money on unsuccessful fertility treatments, Cruz's wife, Jennifer Campbell, was "very depressed and talked about suicide," one source said.
The sources suggested she may have wanted to end her life but that as a devout Roman Catholic, she believed suicide was a sin.
The failure to have a successful pregnancy was "pretty overwhelming thing in their lives," the second source said.
The source closest to Campbell said she still loves her husband despite his arrest. The source would not comment on whether she was aware of the alleged planning before his arrest.
The source closest to Cruz, 48, said he was "nothing but a loving and devoted husband."
CNN was unable to talk Cruz or Campbell directly.
Cruz, arrested in May, remained behind bars pending a $2 million bond payment.
The criminal complaint accused Cruz of trying to hire David Carrington and David Walters -- homeless men who go by the street names Little Dave and Big Dave -- to murder Campbell. It was not immediately clear who was Little Dave and who was Big Dave.
The homeless men solicited to carry out the hit spoke with celebrity news and gossip website TMZ soon after the arrest. One of them called Cruz "very meticulous" but "very cheap" in his planning.
The plan fell apart when one of the men whom Cruz allegedly recruited told Santa Monica police, Sgt. Jay Trisler said. Trisler confirmed that the men interviewed by TMZ were the chief witnesses against Cruz.
Little Dave told TMZ that he was approached first by Cruz, who asked him to kill his wife for cash, and he told his friend Big Dave.
Big Dave said he told a Santa Monica police officer about the plot after he was arrested for loitering.
"We're very fortunate that we have a relationship and rapport with some of the homeless and that they were able to give us information," Trisler said.
Santa Monica police began their undercover investigation of Cruz on May 7, Trisler said. Cruz was arrested at a dog park in the Cheviot Hills neighborhood of Los Angeles on Thursday afternoon, he said.
Big Dave and Little Dave got a place to stay while the investigation was under way. Santa Monica police put them in a hotel room to keep them out of sight, Big Dave said.
"They gave us two pizzas, a 12-pack of beer and a bottle of San Jose," he said. "I love them."
Cruz, a Los Angeles resident, was an overweight pastry chef at the Hotel Bel Air until he changed his focus to promote low-calorie recipes.
He wrote "The Juan-Carlos Cruz Calorie Countdown Cookbook: A 5-Week Eating Strategy for Sustainable Weight Loss," published in 2007.
The Food Network issued a short statement Monday saying Cruz "has not been under contract or associated with Food Network for a number of years."