Sen. John McCain (R-Ariz.) on Monday endorsed former Maryland Gov. Robert Ehrlich in the state's GOP gubernatorial primary, pitting him against his former presidential running mate, Sarah Palin.

The former GOP Alaska governor and potential 2012 presidential candidate endorsed Republican investor Brian Murphy, a once-little-known candidate who is mounting a primary challenge against Ehrlich.

McCain told the Associated Press that Ehrlich is a "fine guy" and that he is backing his shot at another term in office. 

The Maryland governor's primary is one of the first in which McCain and Palin have found themselves supporting opposing candidates.

Palin has endorsed a number of candidates in key primary races who have courted the backing of the conservative Tea Party movement. In other contests, Palin had backed establishment office seekers. She endorsed McCain in his primary contest against former Rep. J.D. Hayworth, who tried to channel Tea Party support to knock off the 2008 GOP presidential nominee.

Murphy is running to the right of Ehrlich, who lost to current Gov. Martin O'Malley in 2006 and is now trying to win back his position. The primary election will be held Tuesday.