Zimbabwe police today ordered Ian Smith, the last prime minister of white-ruled Rhodesia, to leave his farm and come to Harare for a search of his home.

A government spokesman denied that Smith, 63, was detained, but after the three-hour search ended late tonight the leader of the white-minority community told reporters that as far as he was concerned, he had been arrested. He had been forced to travel the 200 miles to the capital under police escort, he said.

The police went through "everything" in the house, he said, and took a diary dating back to 1969 covering part of the period he was prime minister as well as papers and some of his writing.

Police were stationed outside the house tonight, but Smith said he was free to go as he pleased and he planned to return to his farm Tuesday to attend a cattle auction.

The government seized Smith's passport last Thursday shortly after he returned from the United States and Britain where he had sharply criticized the black administration of Prime Minister Robert Mugabe. Over the weekend police searched his farms at Mwenezi and Shurugwi, from where he was driven to Harare today.

Blamed by blacks and even many whites for leading the nation into a bloody guerrilla war in a futile attempt to avoid majority rule, Smith still is regarded as the representative of the 160,000 whites, although a number of white politicians have split from his Republican Front party.

"Europeans and Americans judge how things are going in Zimbabwe on the basis of how the whites are faring. Smith is the touchstone, so it is a delicate matter what they do to him," a Western diplomat long opposed to Smith said, noting that the adverse publicity could jeopardize Zimbabwe's massive foreign aid.

On the other hand, analysts note, the government's confrontation with Smith is bound to win votes with the black electorate while Mugabe's policy of postwar reconciliation between former enemies has not always been popular.

The problem is that the harassment of Smith could influence whites to leave in greater numbers, leading to further economic difficulties because their technical skills have been vital in many fields. About 40,000 whites have left since Mugabe gained power.

Smith told reporters tonight that the police had originally agreed that he should return to Harare Thursday to allow the search but it "seems that some megalomaniac who wants to satisfy his whim" reversed that decision and demanded that he return today.