SAN JOSE — The A’s and San Jose are still holding out hope of moving the baseball team to a new ballpark in Silicon Valley.

The Oakland baseball club and its longtime South Bay suitor have agreed on a deal that will extend negotiations for up to another seven years as San Jose tries to win approval from the courts or the MLB for the A’s move south.

“It’s an option, and we want to keep our options open,” A’s owner Lew Wolff said.

The deal, revealed late Thursday, comes just three months after the A’s and Oakland agreed to a 10-year lease extension to keep the team at the O.Co Coliseum. But that deal includes an “out” clause that would allow the team to move to San Jose as soon as later this decade.

“The San Jose project is still alive,” said Mayor Chuck Reed, who recently met with the incoming MLB commissioner. “We know these things can take a while, so we’re providing ample time for the A’s to do whatever they need to do to start a project in San Jose. Seven years ought to be more than enough.”

For years, the A’s have paid San Jose to set aside the publicly-owned land next to the Diridon train station downtown in case the new ballpark was approved, though that arrangement was set to expire in November. The new agreement continues the pact through as late as 2021 and would allow the A’s to buy the 5-acre ballpark site for $7 million if the move is allowed.

“The A’s are still interested in San Jose, and we’re still interested in pursuing it, and definitely have been pushing this for a long time,” City Attorney Rick Doyle said. “I think it’s a marathon.”

Still, Wolff was noncommittal about whether the team was targeting San Jose or Oakland, which is also trying to keep the team with a new ballpark.

“We have not given up on retaining the A’s somewhere in the Bay Area,” he said. “We’re not looking anywhere else.”

The A’s continue to face huge obstacles in moving to San Jose. The San Francisco Giants are still asserting their “territorial rights” to the South Bay in blocking the A’s relocation. It’s been 5½ years since MLB Commissioner Bud Selig agreed to study the issue with a blue-ribbon committee, but that panel hasn’t made any findings public.

Fed up, the city sued last year, but lost in the lower court. A hearing this summer in an appeals court made it clear MLB was the favorite to win that round, too. The city could then appeal to the U.S. Supreme Court. That process could take years, and San Jose voters would also have to approve the move.

Reed, who never was able to secure a meeting with the retiring Selig, said he sat down with incoming MLB Commissioner Rob Manfred last month in New York, a meeting not previously reported. He said the two had coffee and talked baseball but the meeting didn’t substantially change the city’s baseball saga.

Under the new arrangement, San Jose would receive $100,000 over four years, and the deal includes three one-year extensions each worth $25,000. That’s far less than the city could reap for the prime real estate between San Fernando Street and Park Avenue during the current Silicon Valley building boom. Doyle said the city recently had the site appraised for $6 million. But the city sees the long-term financial bonanza of a baseball team as being too attractive to pass up.

Not everyone is on board, however.

“If they’re serious about bringing baseball to San Jose, they have an option to buy, and they should buy the land,” said Councilman Pierluigi Oliverio, who said he will be voting against the new contract.

Contact Mike Rosenberg at 408-920-5705. Follow him at Twitter.com/RosenbergMerc.