After playing a hard-ass politician in Starz’s “Boss,” Kelsey Grammer is looking to keep that edge as he has signed on to play a villain in the Paramount’s Transformers starring Mark Wahlberg.

Pic also stars Jack Reynor and Nicola Peltz. Deadline Hollywood broke the news.

Bay, who’s helmed all three “Transformers” pics, is directing the next installment with Ehren Krueger penning the script.

Plot details are unknown except that it will not be connected to past installments and have a whole new cast of characters.

Lorenzo di Bonaventura, Don Murphy, Ian Bryce and Tom DeSanto will produce. Paramount has slated the pic for June 27, 2014.

Grammer is repped by UTA and manager Brian Sher.