By Randall Palmer and David Ljunggren

OTTAWA (Reuters) - A gunman shot and fatally wounded a soldier in Ottawa on Wednesday and then entered the country's parliament buildings chased by police, with at least 30 shots fired in dramatic scenes in the heart of the Canadian capital.

A suspected gunman was shot dead inside the parliament building, a government minister said.

Ottawa police were searching for more suspects near the National War Memorial in central Ottawa, where the soldier was shot, and on nearby Parliament Hill, a police spokesman said.

Canadian Prime Minister Stephen Harper was in a caucus meeting in parliament when gunfire erupted in the building, Veterans Affairs Minister Julian Fantino, a former policeman, told the Toronto Sun.

Harper was later safely removed from the building, and parliament was locked down.

Fantino said parliament's head of security, Sergeant-at-Arms Kevin Vickers, a former member of the Royal Canadian Mounted Police (RCMP), had shot a suspect dead.

"All the details are not in, but the sergeant-at-arms, a former Mountie, is the one that engaged the gunman, or one of them at least, and stopped this," Fantino said. "He did a great job and, from what I know, shot the gunman and he is now deceased."

Canadian cabinet minister Jason Kenney said the soldier who was shot at the war memorial had died. He said a guard in parliament buildings had been wounded.

"Condolences to family of the soldier killed, and prayers for the parliamentary guard wounded. Canada will not be terrorized or intimidated," Kenney, one of Harper's most powerful ministers, said on Twitter.

A spokeswoman for the Canadian military said she could not confirm that the soldier had died and had no update on his condition.

Dramatic video footage posted by the Globe and Mail newspaper showed police with guns drawn inside the main parliament building. At least a dozen loud bangs can be heard on the clip, echoing through the hallway.

'DANGER HERE'

Story continues

As the drama unfolded, police in dark bulletproof vests and carrying automatic rifles flooded the streets near parliament.

Some took cover behind vehicles and shouted to people to clear the area, saying: "We do not have the suspect in custody. You are in danger here."

Police quickly cleared several blocks of downtown Ottawa. By noon ET, the streets were empty.

Several police cars were parked on the lawns outside the parliament buildings. Small groups of police could be seen sheltering behind at least two cars.

Members of parliament were told to lock themselves in their offices, and stay away from the windows.

"If your door does not lock, find a way to barricade the door, if possible. Do not open a door under any circumstances," said a security alert issued by parliament officials.

At the time of the shooting the opposition New Democrats were holding their weekly caucus meeting in parliament's Centre Block, where the shooting took place. A tweeted picture sent from the room showed a pile of chairs jammed up against the main door to prevent anyone from entering.

Police told people in downtown Ottawa to stay away from windows and off roofs.

The soldier who was reported to have died in the shooting was taken into an ambulance in which medical personnel could be seen giving him cardio-pulmonary resuscitation. CBC News reported that he was a reservist who had been serving in Hamilton, Ontario.

There was no word yet on the identity of any suspect or suspects or of any motive for the shooting.

The incident came just two days after an Islamic convert ran down two Canadian soldiers with his car, killing one, near Montreal, before being shot and killed by police.

It also took place as the Canadian government prepared to boost the powers of its spy agency, the Canadian Security Intelligence Service. Public Safety Minister Stephen Blaney said last Thursday the new legislation would let the agency track and investigate potential terrorists when they travel abroad and ultimately prosecute them.

In Washington, a White House official said U.S. President Barack Obama had been briefed on the situation. He said the United States had offered assistance to Canada.

Mass shootings are relatively rare in Canada, which has stricter gun laws than the United States. Compared with Capitol Hill in Washington, security on Parliament Hill is also fairly low key. Anybody could walk right up to the front door of parliament's Centre Block with arms and explosives without being challenged before entering the front door, where a few guards check accreditation.

The Canadian military closed its bases across the country following the events in Ottawa, CBC TV said.

(Reporting by Andrea Hopkins,; Writing by Andrea Hopkins and Frances Kerry; Editing by Amran Abocar; and Peter Galloway)