A 27-year-old Hyattsville man identified as Daniel Roger Evans was taken into custody by Montgomery police last night after holding his 6-year-old son hostage for five hours in a Wheaton townhouse and firing a 22 caliber rifle sporadically at police.

The dramatic end to the series of events, which included the escape of Evans' estranged wife from the house came shortly before 7 p.m. At that time Evans apparently fired about 20 rounds out the front of the house, and almost immediately the 6-year-old boy, Daniel Shawn Evans, came out of the house unharmed and carrying the rifle. "He shot them all out," police quoted the boy as saying.

A few minutes later, a team of SWAT officers entered the house, located at 4139 Garrett Park Rd. Observers said the lights in the basement of the house immediately went out. Eight minutes later the SWAT team radioed that "the situation is secure" and asked for an ambulance.

It could not be determined immediately whether Evans or any of the police officers was injured. No shots were heard while the SWAT team was in the house.

Police said they did not know the motive for Evan's actions, but described the incident as "definitely a domestic affair . . . a mother, a father and a child."

According to police, Evans broke into the house, to which his estranged wife and child had moved early last December, about 2 p.m. The wife, identified as Elois Evans, escaped shortly after the break-in. The ensuing ordeal, with Evans barricading himself inside the house with his son ended shortly after police announced they were prepared to storm the house.

Attempts to talk to the man by telephone were apparently unsuccessful, police spokesmen said. They said that after answering the telephone several times and refusing to talk, the man left the telephone receiver off the hook.

A man identified as the brother of the gunman spoke to him through a bullhorn shortly after police arrived on the scene.

"Daniel, this is Henry," the brother said. "What are you doing, boy? Come out and talk to me. Put the gun down and come out. You ain't done nothing wrong. Come on out and talk to me."

Police Lt. Allen Wilson, commander of the county police tactical squad, also appealed to the man to speak with his brother. By late afternoon, however, the man was still refusing to talk.

Dozens of police officers surrounded the house, part of a group of 14 town houses on a quiet residential street. Police sharpshooters positioned themselves behind a fence located at the rear of the row of houses, which is bordered in front and back by woods.

A police command center, where Wilson, police Sgt. Douglas McFee and FBI agent Darol Fry, a specialist in hostages at the Baltimore FBI field office, conferred with the man's wife and SWAT officers, was set up approximately 300 feet from the house.

After several rounds of rifle fire from the house hit police cruisers, officers knelt behind cruisers parked in the driveway and road. Police did not fire any shots, a spokesman said.

Wilson, McFee and Fry were the negotiating team that four days ago arranged the release of seven hostages held by a gunman in a Silver Spring bank. The hostages in that incident were released, and the gunman captured without any shots being fired by the police.

Similar hostage incidents occured in the last two days in Indianapolis and Cincinnati.

According to police, Evans broke into the house at approximately 2 p.m. They said his wife grabbed her son and attempted to run out the back door with him. They said the boy slipped from her hand as she escaped and that she then ran to a neigbor's house and called the police.

Several neighbors, however, said they saw the woman jump from a second-story window and make her escape. When police arrived on the scene, they instructed neighbors to stay in their houses and away from doors and windows.

As daylight began to fade, police ordered streetlights on the block turned off. At approximately 6:30 p.m., after no shots had been fired and no contact made with Evans for nearly two hours, police said they were considering storming the house.