State Representative Eugene O’Flaherty, a Chelsea Democrat who has held the House Judiciary Committee gavel for over a decade, will join the Walsh administration as its top attorney, officials with knowledge of the decision said Monday.

The choice of O’Flaherty comes as Mayor Martin J. Walsh, sworn in on Monday morning, begins to populate his administration and installs a long-time personal friend in a high-ranking post.

O’Flaherty has been Walsh’s closest friend in the House, like him the son of Irish immigrants and like him on the losing side in two consecutive House leadership fights. Unlike Walsh, who was relegated to a lesser role after both battles, O’Flaherty retained his committee chairmanship both times.

Advertisement - Continue Reading Below

The appointment vacates yet another seat in the House. O’Flaherty has represented his district, which includes Charlestown and much of Chelsea, since 1996.

As co-chairman of the powerful Judiciary Committee, O’Flaherty has wielded tremendous control over legislation affecting drunken driving, the courts, sex offenders, and criminal sentencing and records.