Lech Walesa had thought he might be arrested yesterday, just after he announced that he had held clandestine talks over the weekend with underground leaders of the banned Solidarity labor union that he once headed.

But police surprised him, waiting until today when they came to his home here, threatened to use force if he resisted them, and took him away for five hours of questioning as his wife shouted at them and several of his seven children cried and screamed.

"You should abide by the laws," the hero of Poland's crushed independent labor movement chastised the police, who had come without a warrant.

Then, as they led him to their unmarked car, he turned to me as I stood in the doorway of his home and said, "Tell the whole world they are breaking the law in an obvious way."

I had been interviewing Walesa's wife Danuta in their apartment in a suburb of Gdansk this afternoon when the police came and I waited with his family and friends through the tense hours of uncertainty as they tried frantically to find out what was happening to him.

When he returned five hours later, tired and tense, he said he had refused to answer questions by the police about his weekend talks and did not expect further charges to be brought against him.

Nonetheless, he said, as he greeted his joyous family, "They once again stole several hours from my life."

Jerzy Urban, the chief spokesman for the Polish government, said in Warsaw that Walesa had not been charged but he gave no details of his detention.

An official government statement on Polish radio and television later tonight said: "Western news agencies have reported about Lech Walesa's meeting with the illegal so-called Provisional Coordinating Commission of the former Solidarity union.

"Today a talk was held with Lech Walesa at the citizens' militia provincial headquarters in Gdansk during which he did not confirm the above information. After explanations Walesa was allowed home."

While Walesa was in custody, the State Department issued a statement saying that it was "deeply distressed" at his detention and calling on Polish authorities to release him. There was no further U.S. comment after he was released.

It was the second time police have detained Walesa without specific charge since his release in November from 11 months of internment that began with the imposition of martial law in December 1981.

On Dec. 16, he was picked up by police and driven around Gdansk for several hours to prevent him from speaking publicly at ceremonies marking the highly charged anniversary of the shooting in 1970 of protesting workers at the Gdansk shipyard.

In recent weeks, Walesa has answered several formal summons from authorities to address allegations about misuse of Solidarity funds and personal tax evasion and to provide testimony in the coming trial of five leaders of the dissident Committee for Social Self-Defense (KOR) who became active in Solidarity.

Several Walesa aides, some of whom were present when he was taken into custody today, said he had thought something might happen yesterday, after announcing his secret meeting with the Provisional Coordinating Commission, the fugitive coordinators of resistance against Poland's military government.

A statement from Walesa yesterday had said only that in their talks he and the others had "discussed in detail the country's present situation and coordinated their stands."

But later yesterday Urban, in a press conference, said that such a meeting was not necessarily illegal unless it could be shown that criminal intent was involved or that Walesa had assisted the fugitives, and Walesa, according to the aides, concluded that the police would not bother him.

Then today, at 2:10 p.m. 7:10 a.m. EST as I interviewed the wife of the Solidarity founder in their home--three apartments joined to provide six rooms on the second floor--the police came.

A plainclothed man accompanied by two uniformed officers appeared on the doorstep and told Walesa to come with them. When they produced no warrant, he refused, although under Polish law police may detain people for up to 48 hours without charge.

A half hour later the same three policemen returned--the uniformed officers with gun belts and the plainclothed man with a pistol shoved into the waistband of his trousers--and they threatened to use force to take him into custody.

As his wife, Danuta, shouted at the police and his children screamed in terror, Walesa agreed to go to avoid a confrontation in his own home.

The police, eager to get away from the scene of crying and confusion, ignored me as I stood and watched, and I said nothing to them.

"You should abide by the laws," Walesa told the officers as he donned a dark brown jacket over his brown corduroy trousers and gray sweater. "You want me to. You should too."

Then he told me to "tell the whole world" and he was gone.

For the next few hours, Walesa's family and friends tried to learn what was happening to him.

Walesa's close friend and spiritual adviser, the Rev. Henryk Jankowski, a Roman Catholic priest who had been closely associated with Solidarity in the Gdansk shipyard, visited the home shortly after the labor leader had been taken away. Later he told Reuter news agency, "Such actions are wholly unnecessary as far as achieving national accord is concerned."

At 4 p.m., Danuta Walesa reached Gen. Jerzy Andrzejewski, Gdansk's chief of police, by telephone and desperately demanded to know what was happening.

"My husband has been kidnaped!" she screamed to the police chief. "They did not present a warrant. I want to know why and where he was taken."

Andrzejewski reportedly told her to come to the police station to be questioned herself, telling her repeatedly that it would be in her interest to do so. She adamantly refused and countered by inviting him to come to her home and ask any questions he had over coffee.

Accusing the police chief of trying blackmail, she said, "I think it's enough my husband is there. He'll explain everything so far as my interest is concerned."

For 15 minutes the argument want back and forth before Danuta Walesa gave up and continued her wait.

At 7:10 p.m., a police car brought Walesa home and, as family and friends surrounded him, he said he had been questioned by a colonel and one other officer from Warsaw but had refused to answer questions about his weekend meeting.

He said he had told them that "as a free man" he had a right to meet with anyone, as long as it was without criminal intent and that he had referred them to Urban's statement yesterday making the same point.

"I refused to answer any questions on the meeting," he said.

Walesa said that, late in the day when police told him they wanted to question his wife, he got angry and told them not to mix her into it. It was not until he got home that he found out that his wife had rebuffed the police chief, and he was relieved to hear it.

Then he told reporters he would have nothing more to say until a press conference next Wednesday, which had been scheduled before today's drama.

"I have a headache. I am too tired to say more," he said to reporters waiting outside, and then an aide suggested that I get off his telephone so that Walesa could have his living room back again.