Mexico's finance secretary said Thursday the government would not object to state-owned oil company Petroleos Mexicanos selling its stake in Spanish energy major Repsol, although he said that decision would be up to Pemex's board.

If Pemex opts to sell its shares in "Repsol, which operates outside Mexico, in order to bring that capital and invest it in opportunities that Pemex will have in Mexico, it wouldn't be a bad decision," Luis Videgaray told Radio Formula.

But that is "a decision that Pemex's Board of Directors must make," he added.

Pemex CEO Emilio Lozoya "is doing what he's obligated to do: explore opportunities," the secretary said.

Lozoya is the one who must explain "Pemex's decisions with respect to its shares in Repsol," Videgaray said in regard to a Spanish media report this week indicating the company's intends to divest its stake.

Pemex is the third-leading shareholder in Repsol with a 9.3 percent stake and it also holds a seat on the company's Board of Directors.

Relations between the two companies have been tense since Pemex doubled its stake in the Spanish oil major as part of a short-lived August 2011 voting alliance with Spanish builder Sacyr.

The heavily indebted construction giant was looking to increase its voting power on Repsol's board as a means of boosting dividend payments, but the pact fell apart months later when Sacyr - under pressure from creditors - was forced to sell half of its 20 percent in Repsol back to the company.

In January 2012, Repsol and Pemex signed an agreement to normalize relations that included a 10-year commitment by the Mexican company to keep its stake in a range of between 5 percent and 10 percent.

Repsol's chief financial officer, Miguel Martinez, said Thursday in Madrid that the Spanish company was "completely open" to improving its relationship with Pemex and reaching agreements on issues that are not working well.

Pemex, which will face competition in Mexico from other oil producers thanks to last year's historic energy overhaul ending its 75-year monopoly, said in March that it planned to invest nearly $28 billion in 2014, mostly on oil and gas exploration and production.

Mexico's oil production has fallen by nearly a quarter from a high of 3.3 million barrels per day in 2004 due to a sharp decline in output at offshore Cantarell, formerly Mexico's most productive field, and a lack of investment. EFE