Updated

The Arizona Diamondbacks agreed to terms on a two-year contract with pitcher Brandon McCarthy on Friday.

The deal worth $15.5 million, according to MLB.com, and will become official pending a physical.

Over 18 starts with the Oakland Athletics last season, McCarthy posted an 8-6 record and a career-best 3.24 earned run average.

The seven-year veteran missed the end of the 2012 season after he was struck in the head with a batted ball in a game against the Los Angeles Angels on Sept. 5.

McCarthy needed surgery to repair an epidural hemorrhage, brain contusion and skull fracture, but is expected to have a normal throwing program this winter.

In 153 career appearances -- 99 starts -- McCarthy is 37-39 with a 4.02 ERA and 447 strikeouts. The right-hander has previously pitched for the Chicago White Sox and Texas in addition to the A's.