Updated

Chicago, IL (SportsNetwork.com) - Jason Hammel is returning to the Chicago Cubs.

The right-hander agreed to a two-year contract on Friday. Financial terms were not disclosed, but the deal includes a club option for the 2017 season.

Hammel signed with the Cubs last February and was 8-5 with a 2.98 ERA in 17 starts before being shipped to Oakland with Jeff Samardzija on July 5. He went just 2-6 with the Athletics, finishing the campaign 10-11 overall with a 3.47 ERA in 30 outings.

The 32-year-old veteran will be reunited with new Cubs manager Joe Maddon. Hammel pitched for Maddon in Tampa Bay from 2006-08, helping the Rays to the World Series in his final year, although he did not pitch for Tampa Bay in the postseason.

After his three-year stint with Tampa Bay, Hammel also pitched for Colorado (2009-11) and Baltimore (2012-13) prior to last season. He made one start for the Rockies in the 2009 postseason and two starts for the Orioles in the 2012 playoffs.

In 245 major league appearances, including 187 starts, he owns a career record of 59-70 with a 4.60 ERA.