Brian Roberts, who has spent his entire 13-year career with the Orioles, has agreed to a one-year deal worth $2 million plus incentives with the Yankees. (Frank Franklin II/Associated Press)

The Baltimore Orioles’ lengthy pursuit of free agent closer Grant Balfour ended Tuesday as the club agreed to terms with Balfour on a two-year deal.

The deal will be worth a total of $15 million guaranteed — with $1 million of that deferred — pending a physical. The sides had been trying to work out a deal for several days, going back to Major League Baseball’s winter meetings in Lake Buena Vista, Fla., last week.

Balfour, who served as the closer for the Oakland Athletics in the past two seasons, had been seeking a three-year deal. But the Orioles, who looked to add a closer after their trade of Jim Johnson to the Athletics on Dec. 2, were apprehensive to offer three years to Balfour, who turns 36 later this month.

Balfour had 62 saves in 67 opportunities since becoming a full-time closer in 2012 for the Athletics, who won back-to-back American League West division titles.

He was 1-3 with a 2.59 ERA and 38 saves in 41 opportunities for Oakland last season after saving 24 of 26 chances in 2012.

The Post Sports Live crew recalls the highlights from the year in Washington sports. (Jayne Orenstein/PostSportsLive/The Washington Post)

The move fills the void left when the Orioles traded Johnson to the Athletics for second baseman Jemile Weeks and minor league catcher David Freitas.

Johnson was projected to earn around $10 millon in his final year of arbitration and was shipped to Oakland in what Orioles executive vice president Dan Duquette termed a “reallocation of resources.”

Balfour has experience pitching in the AL East. Before joining the Athletics, the Australia native pitched for Tampa Bay from mid-2007 through the 2010 season.

But it wasn’t until 2012 when he received the opportunity to become a full-time closer.

He joined Oakland in 2011, when he signed a two-year, $8.1 million deal with a $4.5 million third-year option, which the Athletics picked up.

Also, second baseman Brian Roberts, who has played his entire 13-year career with the Orioles, has agreed to a one-year deal worth $2 million plus incentives with the New York Yankees.

Roberts is among the Orioles’ all-time leaders in stolen bases (278; third), doubles (351; fourth), runs (810; seventh) and hits (1,452; 10th).

— Baltimore Sun