Five people were shot, one fatally, at a gym in Washington's Logan Circle neighbourhood on Thursday morning, and the gunman later died of an apparent self-inflicted gunshot after barricading himself in a nearby apartment building and firing at police officers, officials said.

The shooting began at about 8:23 a.m. at the VIDA Fitness club near 15th and P streets NW, about a mile north of the White House. One victim died and one of the four wounded was in critical condition, while the other three had non-life-threatening injuries, police said. James Spellman, who was at the gym when the shooting started, told the Associated Press he saw one man shot in the head and fall to the ground as about 50 people were working out.

The suspect, a white man, fled into an apartment building above the gym and barricaded himself on a high floor, firing several times through the door at officers, interim Police Chief Jeffery Carroll said. Negotiators spoke to him by phone, and officers then heard a gunshot; on entering the room, they found the man with a self-inflicted gunshot wound. Carroll said investigators believed the gunman had a conflict with his building's homeowners association. A fire was set at some point during the standoff and was put out.

Schools near the scene were placed on lockdown and police issued a shelter-in-place order as the FBI, the Secret Service and the Bureau of Alcohol, Tobacco, Firearms and Explosives joined the response. Mayor Muriel Bowser said the city was "devastated" by the shooting, praised the police response and said the White House had been briefed. The motive remained under investigation.

The attack comes as the Trump administration has made crime in the U.S. capital a key issue in the president's second term, deploying National Guard troops across the city and federalising control of the local police force after declaring a crime emergency. Several thousand National Guard troops have remained in the district, and the White House did not immediately comment on Thursday's attack.