Ginobili, who became an unrestricted free agent earlier this week, announced the news in a tweet Wednesday morning: "Thrilled to announce that as I always hoped, I'm gonna stay with the @spurs for two more years."
Terms of the agreement have yet to be announced.
The 35-year-old guard has spent his entire 11-season NBA career with the Spurs, who drafted him in the second round in 1999. He is a two-time All-Star and a member of three NBA championship teams.
Ginobili is coming off arguably the worst season of his career, however, having averaged 11.8 points per game and 4.6 rebounds per game. He shot just 42.5 percent from the field and 35.3 percent from 3-point range while serving primarily in a sixth-man role.
Following the Spurs' Game 7 loss to the Miami Heat in the NBA Finals last month, there was some speculation that Ginobili might retire. However, he wrote a column for an Argentinian newspaper in which he announced he was leaning toward playing at least one more season in the NBA.