Alexandria lured the National Science Foundation to the city this summer with a tax incentive package worth $28 million, but a proposal to replace half the money that the local affordable housing fund would lose in the deal split the City Council in its all-day meeting Saturday.

After heated debate, the council members voted 5 to 2 to direct the city manager to set aside $500,000 from taxes that the city expects to collect on the property between groundbreaking and occupancy and spend it on increasing affordable housing in Alexandria.

“Even though this is a very unique project, it’s still a major project,” said council member John Taylor Chapman (D), who led the effort to return some tax money to the city’s housing fund. “It’s so much more important to get those big fish when you can. . . . This shows we’re not only thinking about affordable housing, but we’re trying to be creative about how we get it.”

The General Services Administration agreed to relocate the NSF from Arlington to Alexandria this past June in one of the largest transfers of federal workers since the Patent and Trademark Office moved from Crystal City to Alexandria in 2005. Alexandria lured the 2,100 NSF employees — and an estimated 1,800 additional workers in related businesses — with an incentive package that promised partial real estate tax relief for the next 15 years. The city also dropped its usual request for voluntary contributions to its Eisenhower Avenue improvement fund, worth about $750,000, and its affordable housing fund, which would have raised $1.04 million.

Affordable housing advocates objected to the loss of that money, pointing out that Alexandria has lost 12,000 rental apartments in the past dozen years that are affordable to families that make less than $60,000 a year. One resident urged the council to “think hard about the cumulative effects” that waiving the housing fee would have, and the head of the city’s Economic Opportunity Commission added that the waiver set a bad precedent for future projects.

Mayor William D. Euille (D) said this was the first time the city has bargained away a request for a contribution to its affordable housing fund but that it was a special case because the competition for the NSF was so stiff.

City officials said the arrival of the federal agency will bring in tens of millions of new dollars in both taxes and economic development, including an estimated 90,000 hotel stays, a new apartment building and two new office buildings. They estimated that companies that work with NSF and visitors to the foundation would bring in an additional $50 million in taxes alone.

Council members Paul Smedberg (D) and Justin Wilson (D), who voted against the measure, called it a bad precedent to appropriate money before it’s collected and to favor one city priority over another before council members consider the entire budget.

“I agree [affordable housing] is a priority, it’s just not the only priority we have,” Wilson said. “The reality is without this incentive package, we’d have nothing.”

Smedberg agreed. “We all recognize the need for affordable housing, as well as a whole host of other things,” he said. “But to dedicate dollars from revenue we haven’t realized yet, I just think is a terrible practice. . . . I want to debate this in the context of all our core infrastructure needs, schools, sewers and any unknown emergencies. . . . I want to have a system in place that helps us achieve our affordable housing goals that is financially sustainable. I do not think this is the way to do it.”