Three black South African leaders who avoided political detention by taking refuge in the British Consulate here three months ago, left the mission today and two of them were arrested immediately on charges of high treason.

Security police officers served orders of arrest on the two men as the elevator reached the ground floor of the downtown bank building, where the consulate is located.

They were hustled through a back door and whisked away to prison, while a crowd of about 5,000 supporters waited out front to welcome them.

The third man, Billy Nair, who was released last February after serving a 20-year prison sentence under the country's stringent security laws was allowed to go free and the chanting crowd carried him shoulder-high around several city blocks before police with dogs dispersed them.

The arrested men, Archie Gumede, 71, and Paul David, 46, bring to eight the number of black leaders charged with treason since the Pretoria government began releasing political detainees last Friday night, following a series of antiapartheid demonstrations in Washington and President Reagan's meeting with Nobel laureate Desmond Tutu.

It is thought here that the South African government is releasing the prisoners in response to U.S. pressure, but intends to stage a series of show trials to reassure its white Afrikaner supporters that it has not become lenient.

Five other detainees who were released Friday, the organizing committee of a two-day protest strike by black workers last month, have been charged with "subversion" for interrupting industrial production for political ends.