Flags of the outlawed African National Congress were unfurled in downtown Johannesburg for the first time in 22 years today as a large multiracial crowd attended the funeral of Neil Aggett, the 27-year-old labor union official who died in security police detention Feb. 5.

The crowd, which journalists estimated at between 2,000 and 3,000, carried the banners with them as they marched and rode in buses five miles through the white suburbs to the cemetery where Aggett was buried.

They sang congress freedom songs as they went, raised their fists in black power salutes and shouted the African word amandla, meaning power, the slogan of the black consciousness movement.

No such open scenes of support for black political movements have been seen in South Africa for many years.

The main African nationalist parties, the African National Congress and the Pan-Africanist Congress, were outlawed in 1960. Since then, the security police have clamped down on any activity considered supportive of them.

Permission is required for mass demonstrations, and it is rarely given. Police have even broken up poster demonstrations by more than one person at a time.

However, the South African authorities have been embarrassed by the death of Aggett, the 46th political detainee to die in custody, and the police appeared anxious to avoid adding to the embarrassment by clashing with the mourners.

While staying in the background, they kept close watch on the Anglican cathedral downtown where the service was held and the burial site.

The main funeral oration was given by Jan Theron, the son of a former Afrikaner judge who is national secretary of one of the biggest black labor organizations, the Food and Canning Workers' Union. Aggett, who is white, gave up his medical practice to work for the union and was one of 17 people detained by the security police in a series of raids in November.

Theron accused the government of killing Aggett, who was found hanged in his cell. The police maintain he killed himself.

Hendrik Koornhof was there, brother of Pieter Koornhof, who is the Cabinet minister in charge of black affairs. His daughter, Hanchen, was detained at the same time as Aggett, who was picked up in a sweep Nov. 27 on suspicion of working to subvert the government.