Halifax Engineering Inc. may be one of the most sophisticated and expensive repair/maintenance shops around.

Companies that make the B-52 bomber depend on the Alexandria-based firm to get them fixtures for airframe parts that are in short supply. The B-52 is one of several aircraft that the Air Force sends to Halifax so engineering studies of their sophisticated navigational systems can be performed.

Halifax, which was founded in 1967 and now employs about 1,000 workers nationwide, is one of several firms in the Washington area that provide technical, engineering and support services to the government.

The company, which works for almost every federal agency, has its hands in everything from aeronautical engineering to naval architecture to computer maintenance. It is conducting projects in such intricate areas as marine systems engineering, computer-based information systems, electronic and physical security, microwave communications systems, and logistics and support systems.

Much of the work now done by private contractors like Halifax used to be performed by the military, but that is no longer considered the most efficient way to get things done.

"There is a trend for more government technical services work to be done outside the government," said John Sanders, a financial analyst with Wachtel & Co.

The Greater Washington Research Center reported a few weeks ago that purchases of goods and services by the federal government have become more important to the metropolitan area's economy than federal employment. The report was based on a study by George Washington University professor Stephen S. Fuller.

Halifax does 98 percent of its business directly with the government, more than half of it for the Defense Department. In one of its largest contracts, Halifax provides support and technical documentation to the Navy's prime shipbuilder in the Auxiliary Rescue Salvage Program. The company tests the safety of ships and publishes technical manuals on equipment and systems.

Halifax also has supported the Amphibious Warfare Division of the Naval Coastal Systems Center in Panama City, Fla. And for the past five years, it has evaluated missile systems for the Naval Sea Systems Command and Naval Surface Weapons Center.

The company operates the locks and bridges on parts of the Intracoastal Waterway, and it owns a small boatyard in Suffolk, Va.

"When we are contracted by the government, we are responsible for getting the work done -- supervising, managing it and providing all the resources," explained Halifax's new president, Howard C. Mills. "We don't manufacture any products. What we do is provide services -- maintenance, repair, engineering and design."

Halifax also provides security guards for many government agencies and has an in-house training academy with an indoor firing range.

One of the company's most important security jobs, Mills said, is installing data and voice communications equipment for "highly secure agencies."

The versatile firm also provides receptionists and tour guides for several federal buildings. Besides the government services it provides, Halifax works for several universities and commercial businesses, mostly in the Southeast.

Despite its lack of glamor, "Halifax is a very solid business and will be for years to come," said Sanders of Wachtel & Co. The company earned about $24 million in revenue last year.

But Halifax reported a second quarter loss last week of $84,171, compared to a profit of $104,457 for the same period in 1983. Its stock, traded over the counter, is now selling for $6.50 a share after originally going public at $10. See Selected Area Stocks listings beginning on page 40.

The problem the company faces is heavy competition in Washington for military and other government technical services contracts. "We have so darn many competitors, especially with the Beltway companies involved in project management," said Mills.

The declining profits, Mills said, were caused by losses in the company's subsidiary boat repair company, Halifax Marine Services, a decrease in large grounds maintenance work at three government installations, and lower-than-expected profits on one government building services contract.

"We have completed the jobs at the boat repair subsidiary, and we have narrowly completed the jobs on ground maintenance, so neither of these should cause us any further problems," Mills said. "The government service contract is still profitable even though we had estimated too much profit on it. We expect a return to profitability in the second half."

Last month, Research Industries, an Alexandria-based private investment firm, purchased 15 percent of Halifax's stock, doubling its interest in the firm. The seller was retiring Halifax President Charles A. Webb Jr., 68, one of the original founders, who unloaded his entire interest in the company.

Research Industries has become a major player in other ways, too. Arch C. Scurlock, the firm's principal stockholder and a director of Halifax for the past 11 years, has succeeded Webb as chairman of the board of Halifax. Research Industries' Vice President John Grover, a former president and chairman of Atlantic Research Corp., was elected to Halifax's board of directors.

Research Industries officials said they acquired Webb's Halifax stock "for long-term investment purposes" and denied there was a takeover move in the works.

"We don't have any plans to increase our share right now," Scurlock said. "I'm not going to tell you that we won't change our minds in the future, but right now we have no intention to acquire this business."

Scurlock and other Research Industries officials said the Halifax stock purchase was more preemptive than anything else.

Webb, who Halifax says will remain as a director and consultant, came close to selling the company to other buyers. Research Industries preferred that Halifax remain independent.

When Webb stepped down as Halifax's president, Mills, the company's executive vice president and chief operating officer, was elected to succeed him. Mills joined Halifax in 1981 when Halifax acquired Asset Inc., where he had served as president. He said he has been in line for the job of Halifax president since joining the company. Research Industries officials said they do not expect major changes in Halifax's business or senior management.

There is some speculation that Halifax eventually will be acquired by another firm.

"I would speculate that it would happen after the company improves its earning power and can get a better price for its stock," said Elliot Benson, a financial analyst with Ferris and Co. "A logical buyer would be someone in a fairly similar type of business of providing professional services to the government and in particular the Defense Department. I would further speculate that more than a few companies are interested."