By Alonso Soto and Marcela Ayres

BRASILIA (Reuters) - Brazil is considering an emergency loan to the cash-strapped state of Rio de Janeiro as it prepares to host the Olympic Games in less than two months, according to two senior government officials familiar with the situation.

The loan would be guaranteed by the state's participation in local companies and could be extended to the states of Minas Gerais and Rio Grande do Sul, which are struggling to pay employees and pensioners as a crippling recession reduces tax revenues.

"These states need cash injection. There is no other way," said a member of the government's economic team who asked for anonymity in order to speak freely. "These loans will be backed by states' assets such as banks, utilities, gas and sanitation companies."

Eligible states would transfer their stakes in government-led companies to the federal government, which could in turn sell them to private investors as it did during the last states' debt restructuring in the late 1990s, the source said.

Rio's main state-controlled company is its water and sewer provider Companhia Estadual de Aguas e Esgotos do Rio de Janeiro, commonly known as Cedae.

The city of Rio de Janeiro has enough money to complete the infrastructure for the Olympics, but a financial crisis at the state level threatens to disrupt public services during one of the world's biggest sporting events, which starts on Aug. 5.

The oil-producing state, hit hard by the recession and drop in crude prices, faced its worst ever public health crisis this year when unpaid doctors and nurses walked off the job at hospitals and clinics were left without essential supplies such as syringes and disinfectants.

The Rio Olympics, the first held in South America, also has been marred by political turmoil that led to the suspension of the president and an outbreak of the mosquito-borne Zika virus that has been linked to brain malformation in babies in Brazil.

The amount of the emergency loans will depend on how much debt relief the government can give other states also in fiscal distress, another source involved in the talks said.

On Thursday, several Brazilian states seeking relief from debt that amounts to 11.2 percent of Brazil's gross domestic product resumed talks with the government of interim President Michel Temer.

This creates a tricky situation for Temer, who in May replaced suspended President Dilma Rousseff while she stands trial for allegedly breaking fiscal rules. Providing relief to the states could exacerbate a fiscal crisis that has cost the country its hard-won investment grade rating late last year, driving up borrowing costs.

Temer's government has rejected a proposal to pardon state debt payments for two years and lower interest rates retroactively, according to state representatives who met with finance ministry officials on Thursday. More meetings are scheduled for next week.

The finance ministry press office declined to comment. The finance secretary of Rio de Janeiro could be not be reached for comment.

Rio de Janeiro's finances have deteriorated so much that the state missed debt payments to a French development bank and the Inter-American Development Bank last month. Moody's Investor Services called the event a "credit negative for all of Brazil's states."

The state ramped up its payroll during years of high oil prices, expecting that royalties on massive crude discoveries off its coast would keep its coffers full.

Now the state is cutting social programs, eliminating secretariats and raising taxes to plug an expected budget deficit of 19.9 billion reais ($5.91 billion) this year.

Rio Grande do Sul-state Finance Secretary Giovani Feltes confirmed the negotiations for the loans, which he said will be used only for investment, but will give his state a much-needed breather.

"This loan will not go to current expenditures because the law doesn't allow us to use loans to pay our employees," Feltes said in a phone interview. "Obviously this (loan) would improve out fiscal situation."

(Reporting by Alonso Soto and Marcela Ayres; editing by Daniel Flynn and Chizu Nomiyama)