Spanish oil company Repsol said Tuesday it had made the first step in taking legal action against Argentina for nationalizing its energy firm YPF.

In a statement, Repsol YPF SA said it had sent a letter to Argentine President Cristina Kirchner notifying her that it sees a controversy in the seizure of YPF which should be resolved by the World Bank's International Center for Settlement of Investment Disputes.

Repsol said the notification represented the formal start of legal action to have the nationalization declared illegal and Argentina obliged to reverse the decision and, or, compensate for it.

Both sides have six months to negotiate a solution before petitioning arbitration by the World Bank agency, Repsol said.

The Spanish company claims the nationalization violated several points of the Treaty for the Promotion and Protection of Investments, among them not providing adequate compensation.

Argentina's government took a 51 percent controlling stake in YPF last month, with congress overwhelmingly approving the move in early May. The government claimed Repsol was not investing sufficiently in the country's oil industry, an allegation the Spanish denies.

The seizure prompted criticism from Spain, the European Union, the United States and even some Latin American leaders.

The Spanish government has threatened to retaliate but so far it has only announced that it would promote domestic biodiesel fuel production, thereby reducing biodiesel imports from Argentina.

The move has conversely been highly popular in Argentina and is seen as a historic reassertion of national sovereignty.

Respol took control of the formerly state-owned YPF in the late 1990s. It said last month that YPF was worth $18.3 billion and valued Repsol's stake at $10.5 billion.

Bolivia followed Argentina by nationalizing a Spanish company that owned most of its electricity grid this month but said it would pay compensation.

Repsol's shares were down 1.5 percent at (EURO)13.60 ($17.47) in generally lower trading on Spain's Ibex 35 index.