Montgomery County Finance Director Alex Espinosa is leaving the suburban Maryland jurisdiction to become the chief financial officer for Stafford County, Va., according to Montgomery officials.

Espinosa, a 21-year county employee, has been in the top role at the finance department since August 2016. He was one of the department heads that County Executive Marc Elrich (D), who took office in December, had announced he was keeping in his new administration.

“Alex Espinosa served the county well for more than 21 years; and I am especially grateful for the work he has done leading up to, and beyond, my administration’s transition period,” Elrich said in a statement. “Though I invited him to stay, an exciting opportunity opened up for Alex and it would have been hard to pass up. . . . He will be missed; and I wish him and his family well.”

Alex joined the Office of Management and Budget in December 1997 as a budget analyst and moved into leadership roles. Elrich credited Espinosa for helping ensure the county’s AAA bond rating and for strengthening financial controls.

Montgomery County is Maryland’s most populous jurisdiction, with about 1.1 million people. Stafford County, Va., has a population of just under 150,000.

Espinosa earned an annual salary of $200,000 in 2018, according to Montgomery County employee records. It was unclear what his salary will be in Virginia.

Espinosa’s last day with the county will be April 5. He did not respond to a request for comment, and a spokesman for Elrich did not have an immediate comment Friday.