* Temasek lifts Repsol stake by 5 percent for $1.4 billion
* Discounted deal means 148 mln euro cash loss for Repsol
* Transaction seen as big positive for Repsol credit ratings
* Repsol shares up 1.8 pct at 1430 GMT
By Sarah White and Tracy Rucinski
MADRID, March 4 Spanish oil group Repsol has sold a 5 percent stake to Singapore's government fund, Temasek, in a further step towards financial stability after the sale last week of gas assets to Shell.
Temasek, which has been boosting investments in the energy sector, bought Repsol's entire portfolio of treasury stock for 1.04 billion euros ($1.35 billion), lifting its holding to 6.3 percent, Repsol said on Monday.
Repsol made a 148 million euro loss on the transaction, after selling the stock at a discount.
But the deal should help Repsol's credit rating, under scrutiny since Argentina expropriated its majority YPF stake last year, triggering concerns over funding and growth.
"This deal draws a line under the credit rating issue for Repsol and gives them a long-term investor of the size of Temasek," Brendan Warn, analyst at Jefferies.
For Temasek, the world's ninth-biggest sovereign investor, the deal is part of a strategy to deepen its exposure to the energy sector through a growth-oriented company, its managing director for investment Tay Sulian said in a statement.
Repsol, which last week beat earnings forecasts for the fourth quarter, helped by strong production growth, has been in recovery mode since the seizure of cash contributor YPF.
It had to focus on asset sales to chip away at its big debt burden as it tried to hang onto its investment-grade rating.
Repsol last month sold liquefied natural gas assets to Royal Dutch Shell for $4.4 billion cash, and said its net debt would halve to 2.2 billion euros once the deal is completed.
On Friday, ratings agency Moody's changed its outlook for Repsol to "stable" from "negative", citing progress in cutting its debt, while Fitch did the same at the end of January.
The Temasek deal helps Repsol rid itself of the last chunk of treasury stock it took on in a roundabout way from former shareholder Sacyr Vallehermoso, a loss-making Spanish building company, and gives it a more stable shareholder base.
Bank creditors of indebted Sacyr, which ended up with 10 percent of Repsol as part of a refinancing deal for the builder, sold that stake back to the oil major at the end of 2011.
Repsol had already shed 5 percent of the treasury stock in early 2012, selling the shares to market investors at a profit.
In the latest deal, Temasek paid 16.01 euros a share, or a 1.7 percent discount to Friday's close, and became Repsol's fourth largest shareholder behind bank La Caixa with 12.7 percent and Sacyr and Mexico's Pemex with about 9 percent each.
Shares in Repsol were up 1.8 percent at 16.585 euros around 1430 GMT, one of the top performers in Spain.
Warn at Jefferies said he thought the transaction implied a fair valuation, even though it will hit Repsol's cash reserves.
Temasek, which has over 115 billion euros of assets, already has some big stakes in energy groups, including 5 percent of U.S. oil company Chesapeake and 40 percent of U.S. oil field services group FTS International, its website showed.
Energy investments only made up 6 percent of Temasek's portfolio in its last financial year, ending in March, compared with 31 percent of investments in the financial industry, including big stakes in DBS Group Holdings and Standard Chartered.
But Temasek's energy investments made up 3 percent of its portfolio the year before, and it recently hired a senior executive to look at opportunities in the liquefied natural gas sector.