San Francisco will be the first city in the nation to offer free community college to all residents starting this fall, Mayor Ed Lee announced this week.

The city will pay for it by taxes on properties selling for more than $5 million.

The real estate transfer tax, as it's called, was increased last year for both residential and commercial properties. The hike was approved by voters in November.

The tax starts at 2.25% and goes up to 3% for properties worth at least $25 million. It's expected to bring in an average of $45 million a year, according to the city controller. But the money goes into the city's general fund and is also expected to be used for affordable housing and senior support services.

The free tuition plan is expected to impact about 28,000 residents who currently take classes at City College of San Francisco and encourage more people to sign up. Chancellor Susan Lamb said the school has the capacity for 85,000 students.

It's difficult to predict how many more people will enroll, and how much the free-tuition plan will end up costing. San Francisco has committed $5.4 million a year for the next two years, and then will have to reassess. That includes a one-time $500,000 stipend to City College to help handle an influx of students.

Related: Why New York's 'tuition-free colleges' still cost $14K

San Francisco's tuition-free plan is more progressive than others round the country. First, everyone is eligible as long as they have resided in San Francisco for at least one year.

It covers the $46 cost per credit no matter how rich you are, "even to the children of the founders of Facebook," said city lawmaker Jane Kim.

You don't have to be enrolled full-time or be a recent high school graduate. This means that people who are seeking job retraining or want to take a few foreign language courses won't have to pay for the cost of the credits.

Related: Rhode Island governor wants to make college free, too

Students will still be on the hook for the mandatory $17 per semester fee at City College and the cost of books, so college won't necessarily be free.

What also sets apart San Francisco's plan is that it offers the poorest students additional money to help pay for these other expenses. An individual has to earn less than $17,000 a year to qualify for the aid, or less than $37,000 for a family of four. Eligible full-time students will get $500 a year and part-time students will get $200 a year.

"We have the fastest growing income gap than any city across the nation," Kim said on Monday at a press conference.

"Making city college free is going to provide greater opportunities for more San Franciscans to enter into the middle class and more San Franciscans to stay in the middle class if they currently are," she said.

The push for free tuition is gaining support across the country. Tennessee started offering free community college to residents in 2015, and will expand the program this year to include adults returning to school. Lawmakers in New York are discussing a program that would make four-year and two-year public colleges tuition-free for residents who earn less than $125,000 a year. And Rhode Island's governor is pushing for two free years at public colleges for recent high school graduates.