George Washington University has signed an agreement to buy a new luxury apartment building in Rosslyn, across the Potomac River and more than two miles from its campus, with the plan to move hundreds of juniors and seniors there in the fall.

The move would mark the first time the District's largest university has housed students outside the city. It comes as GWU is struggling to comply with a strict new city zoning order intended to reduce the density of undergraduates in the historic Foggy Bottom neighborhood.

Linda Schutjer, the university's associate general counsel, said the purchase of the Gallery, at 1800 N. Oak St. in Rosslyn, was intended partly as a real estate investment and partly as a remedy for the housing problem. The 19-story building, whose construction is nearly completed, will feature about 370 units, at least 100 of which have been leased to the public. She said 125 units will be reserved for students.

Still, even with the planned expansion into Virginia, university officials acknowledged yesterday that they remain far short of meeting the District's court-ordered housing requirements this year. In particular, the school has decided to continue housing some freshmen in an off-campus dorm near the Watergate complex, in violation of the city's order that all GWU first- and second-year students must live on campus starting in the fall.

GWU officials said they were simply not able to buy, lease or build enough rooms for its growing undergraduate population in time to comply with the city's order, which the university continues to challenge in court.

"It's not that we don't want to," said Dennis Blumer, the school's vice president and general counsel. "It's our hope we can get there by August 2004."

But the lack of progress infuriated Foggy Bottom neighborhood activists, who have long pressed for more boundaries on the fast-growing institution. "They shouldn't be above the law," said Ron Cocome, president of the Foggy Bottom Association. "They're trying to cram as many people into a small neighborhood as they can and not care about the consequences."

In February, the university lost the latest round in a long-running battle with the city, which has been trying to compel GWU to house more of its students in residence halls.

Under the 10-year campus plan issued by the city Board of Zoning Adjustment in early 2001 -- and upheld by the federal appeals court this year -- GWU was ordered to provide beds for more than 70 percent of its nearly 9,000 full-time undergraduates on campus or outside the Foggy Bottom area by fall. By 2006, that proportion of students must be housed solely on campus.

GWU now offers about 4,668 beds on its Foggy Bottom campus, more than 1,000 short of the requirement.

Though GWU has long traded on its proximity to the White House and other centers of federal power to lure students, Schutjer predicted that the Rosslyn site would appeal to upperclassmen. Students who live there will be allowed more freedom than in residence halls, with the ability to live with nonstudents if they choose. "It's only one stop away" on the Metro, she noted.

College officials, who declined to disclose the purchase price, said they have discussed the pending purchase with Arlington County officials, who they said raised no objections to the influx of undergraduates -- except for urging the university to require 12-month, rather than nine-month, leases.

Cecilia Cassidy, executive director of Rosslyn Renaissance, a business and community organization, said she had not heard about the GWU purchase.

Meanwhile, the university remains in a struggle with its District neighbors over the housing of students. Blumer said the school originally had hoped to move juniors and seniors into its Virginia Avenue residence hall, which sits just outside campus boundaries, but found the rooms were too specifically "configured for freshmen."

By failing to comply with the city zoning order, the university could be prohibited from getting construction permits for any nonresidential buildings, a hurdle that could stall a planned business school building on 21st Street. District officials said yesterday that it would be up to the zoning administrator and city attorneys to determine what, if any, action to take against the university.