SAN FRANCISCO (AP) — Free agent left-hander Javier Lopez has reached agreement on a $13 million, three-year contract to stay with the San Francisco Giants.

The deal is pending a physical, likely to take place next week, assistant general manager Bobby Evans said Thursday.

The 36-year-old Lopez went 4-2 with a 1.83 ERA in 69 appearances and 39 1-3 innings this year, when the Giants missed the playoffs one season after winning their second World Series in three seasons.

San Francisco acquired Lopez at the 2010 trade deadline from Pittsburgh for John Bowker and Joe Martinez, and Lopez emerged as a reliable option for manager Bruce Bochy as the club made an improbable run to the city's first World Series championship since moving West in 1958.

More From 600 ESPN El Paso