The brother of Maryland Gov. Martin O’Malley stepped down Thursday as head of the state Democratic Party to become a top aide to the mayor of Baltimore.

Peter O’Malley, a younger brother and close confidant of the governor, takes over as chief of staff to Mayor Stephanie Rawlings-Blake on Friday, according to a statement from the mayor’s office.

O’Malley’s resignation from the state party comes two months after the governor formally tapped him to take on the unpaid role and just days after his first major fundraiser as chairman of the party.

The governor is expected to nominate the party’s first vice chair, Yvette Lewis of Prince George’s County, to fill the role of chairman.

Peter O’Malley’s new position takes him back to City Hall in Baltimore, where he helped then-mayor Martin O’Malley start what has become the governor’s signature performance-tracking program meant to improve government efficiency and responsiveness.

The younger O’Malley has intentionally kept a low public profile, but he has worked behind the scenes on his brother’s campaigns for two decades, including both the 2006 and 2010 gubernatorial races.

Rawlings-Blake is up for election this year, after taking over for former mayor Sheila Dixon, who resigned last year.

O’Malley, who lives in Baltimore, said the new job was too appealing to turn down and called his earlier stint at City Hall “the best job I ever had.”

“To work everyday on making the city better is very satisfying and worthwhile,” he said in an interview.

Although the head of the Maryland Republican Party criticized the governor’s decision to nominate his brother to lead the Democratic Party as part of a pattern of nepotism, political insiders have praised O’Malley’s skills as an operative. He is well known in political circles for his organizational prowess and as a nuts-and-bolts complement to his brother’s big picture approach.

O’Malley earlier served as chief of staff to former Baltimore County executive Jim Smith.