Homeland Security Secretary Tom Ridge announced yesterday that the headquarters for the new Cabinet department will be at a military-controlled base in Northwest Washington for the foreseeable future.

The move, timed to meet a deadline tomorrow, when the 177,000-employee department legally comes into being, caps a contentious and frenetic search in which homeland security officials considered but ultimately rejected several Northern Virginia sites in recent days. Officials said the agency's security and operational needs are too pressing for it to lease space in the Washington suburbs, as first proposed.

Instead, Ridge's spokesman said the department's "initial headquarters" will be in a four-story building at the U.S. Naval Security Station at Nebraska and Massachusetts avenues that serves as the department's national, round-the-clock command center. The gated, 38-acre Naval District of Washington facility, which is five miles from the White House and blocks from Vice President Cheney's residence, houses 32 buildings, including the Navy's global computer and telecommunications systems command.

The homeland security department will immediately move about 100 core staff members from temporary offices in downtown Washington. But the department has postponed thornier questions, such as how many employees will ultimately work at the new headquarters, how much space they will occupy and how long they will stay.

"The facility at the Nebraska Avenue complex provides the department with the assets needed to begin operations immediately," Ridge spokesman Gordon Johndroe said. "This facility will house the office of the secretary, and no decisions have been made about the incoming agencies."

The decision settles one critical first question in an intense debate within the Bush administration about how and on what timetable the new department will consolidate pieces of 22 agencies. Nevertheless, the result upset the expectations of members of Congress and the General Services Administration, which serves as the government's real estate arm. It also frustrated suburban building owners, who had been led by government officials in recent weeks to expect a location in Tysons Corner or the Dulles corridor office park.

Government and real estate experts blamed the false start on shifting department requirements, the breakneck pace at which decisions are being made and the complexity of the most massive government reorganization in 50 years. Key criteria that normally would be established up front, such as size, location and security, were so fluid that a GSA official said they did not learn of certain requirements until yesterday.

Thus, with time running out and security concerns mounting over the sites selected by GSA after a two-month real estate search, Ridge and top aides changed course. Rather than approve a lease of up to 10 years and $250 million that the administration pushed through Congress this month, the department will stay in cheaper, government-owned space, using existing secure communications, video lines and offices and having convenient access to the U.S. Capitol and White House.

Johndroe said the Navy complex will give the department its desired security perimeter from surrounding roads and lies within restricted air space over the nation's capital.

"The most important thing was to be operational Monday," he said, "and this facility provides that." He said that major workplace changes for the estimated 17,000 Washington area federal workers who will work for the department are not expected for several months and will occur "with plenty of notice."

Mayor Anthony A. Williams (D) and Del. Eleanor Holmes Norton (D-D.C.) expressed delight with the announcement.

"We're very pleased," said Williams spokesman Tony Bullock. "We hope they grow roots and stay awhile. I think they'll learn it makes a lot more sense for them to be near the president, near the Congress and near the other federal agencies."

Sen. John W. Warner (R), head of Virginia's congressional delegation, said the department did not rule out housing a permanent headquarters in Virginia, but he expressed surprise at the department's new tack.

"The puzzling feature is, we acted here in the Congress on the representation that there were one or more sites in Virginia that fully met the requirements," said Warner, chairman of the Senate Armed Services Committee. "What changed . . . between two weeks ago and today, frankly, I don't know."

The GSA, whose work was rejected by the department, issued a brief statement upon learning of the decision, saying in part: "This is a team effort. . . . We will continue to help in any way we can, but of course, DHS [the Department of Homeland Security] will choose the location that best fits its needs."

Sources close to the owners of several Northern Virginia sites under consideration declined to comment pending official notice. But several said that each owner submitted a "best and final offer" Jan. 13, expecting a decision as early as Jan. 15.

Since then, the landlords have received no further word. A source close to one of the finalists, when told last night of the decision, expressed frustration at the process.

"There was a lot of work by everyone pursuing this for them to decide at the last minute to go somewhere else entirely," the source said.

Staff writers Craig Timberg and Lisa Rein contributed to this report.