“Men of a Certain Age” creator-exec producer Mike Royce has inked a rich multiyear development pact with 20th Century Fox TV.

Deal calls for Royce to develop new projects for the studio as well as to contribute to existing 20th shows.

The studio had been hoping to land Royce for some time, said 20th TV chairman

Gary Newman. They made him an offer last year but he was unable to make the move when “Men of a Certain Age” got a second-season renewal from TNT. But once it became clear this summer that “Men” had taken its last bow, 20th resumed its pursuit.

“We’ve talked to Mike a lot over the years but he was never available,” said Newman. “The work he’s done speaks to his talent and creativity. We love the diversity of shows he’s done over the years — multicamera comedy, single-camera comedy, one-hour dramedies. … As a writer his characters tend to be grounded in a real place, and then he puts a great twist on things. That’s exactly the formula we look for in a comedy writer.”

For Royce, hitching up with 20th was hardly a tough decision. The studio is home to some of his family’s favorite shows, and he was impressed by the creative risks the studio has taken with skeins like “Glee” and “Modern Family.”

“This is really just a desperate attempt for me to spend more time with my family,” he said. “It’s pretty incredible what (20th TV) has accomplished with its lineup of shows. I wanted to be at a place where I had the potential to do not just one thing.”

Royce served a long hitch as a writer-producer on the CBS laffer “Everybody Loves Raymond.” After that show wrapped in 2005, he spearheaded HBO’s Louis C.K. half-hour “Lucky Louie” before reuniting with “Raymond” star Ray Romano for the much-praised dramedy “Men.”

Royce said he’s kicking around some ideas for family-based programs but wouldn’t detail any specifics. It was no secret that the axing of “Men” in July left him saddened but he’s now ready to saddle up again for greener pastures on the 20th Century Fox lot. “I’m really happy to be moving on,” Royce said. “I went through a whole experience doing something that was very dear to me. It was a tough breakup, and now I’m very happy to be focused on something else.”

Royce is repped by UTA, manager Cary Hoffman and attorney Jared Levine of Barnes Morris.