“There are renters all around the country who have been holding up their end of the bargain and paying their rent faithfully, but the landlord got into trouble, and so the renter is now unfairly facing eviction,” said John Taylor, president of the National Community Reinvestment Coalition, a consumer advocacy group. “It’s really good news that Fannie Mae is doing this. Now the question is whether private sector will follow suit.”

In recent months, skyrocketing foreclosure rates have exposed as many as 70,000 renters to evictions, even though many never missed rent payments, according to analysts who track housing data. In many cities and states, renters can be evicted after their home goes into foreclosure, regardless of how long their lease stretches into the future.

Many financial institutions — including JPMorgan Chase and Bank of America — have policies to evict renters after foreclosure, company representatives said.

Fannie Mae’s initiative is expected to initially benefit as many as 4,000 renters living in foreclosed homes owned by the company. Fannie Mae has traditionally only bought and sold mortgages. But when a loan held by the company goes into foreclosure, Fannie Mae gains ownership of the underlying property until it is resold to new investors.

Fannie Mae owned 67,500 properties in foreclosure at the end of September, according to the company’s most recent filings. Most of those were owner-occupied. Under the new policy, former owners will most likely not be eligible to rent homes they lost in foreclosure.

Last month, both Fannie Mae and Freddie Mac , the other government-controlled mortgage giant, temporarily suspended foreclosures and evictions until early January. Fannie Mae will now offer renters in foreclosed properties month-to-month leases until the property is resold. A company representative said program details were still being worked out.

“While it may be sometimes tougher for us to sell a property when people are in it, we understand that lots of people are in tough situations right now,” said Chuck Greener, a Fannie Mae spokesman. “If a renter wants to stay in their home, we’ll make that happen. And if they want to move out, in many cases we’ll help them pay for the move.”

A spokesman for Freddie Mac said that the company was looking at a number of options, including a program similar to Fannie Mae’s, but that no decisions had been made.

The companies’ regulator, James B. Lockhart of the Federal Housing Finance Agency, issued a statement on Sunday saying that he expected both companies to update their policies shortly regarding renters living in foreclosed properties. Both Fannie Mae and Freddie Mac were taken over by Mr. Lockhart’s agency this year and now operate in a conservatorship.

Representatives of some major banks said it was unclear if Fannie Mae’s new policy would prompt their institutions to change theirs.

“We’re not in the business of managing rental properties, and we’re not in the business of being a landlord,” said Thomas Kelly, a spokesman for JPMorgan Chase, which owns about two million loans. “Clearly the renter is caught in the middle in cases like this. When a property is in foreclosure, we follow the law.”

Some lawmakers and housing advocates say such policies are unjust.

“If your loan is owned by Fannie Mae, you get to stay in your home. If your loan is owned by someone else, you’re on the street,” said Mr. Taylor of the National Community Reinvestment Coalition. “These banks need to realize they’re in the property management business now, whether they like it or not.”

Some lawmakers have complained that evicting renters is unfair. In November, the Los Angeles City Council voted to draft a law that would bar financial institutions from evicting renters living in foreclosed homes.

Last year, the House passed a measure that would require the new owner of a foreclosed property to inform renters at least 90 days before an eviction. That bill failed to pass the Senate. Law enforcement officers in some states have refused to evict residents of foreclosed properties.

But Yadilka Torres, who rents a home in New Haven, Conn., for $775 a month, had no such protection. Fannie Mae took possession of her house in September, when it went into foreclosure. Even though she was current on her rent, she received an eviction notice saying that she and her two young children would have to leave.

She looked for another apartment but could not find anything affordable. Under Fannie Mae’s new policy, she will now be allowed to stay.

“I was feeling so nervous,” Ms. Torres said. “I’ve tried very hard to pay the rent and to pay all my bills, and it seemed unfair this was happening. I’m very grateful we won’t have to move.”