In a swirl of frenetic dancing, charging stallions and blaring trumpets, thousands of horsemen today paraded the pomp and pagentry that have symbolized the conservative military and political might of northern Nigeria for half a millenium.

Doing honor to their Moslem emirs, the stir influential but no longer absolute temporal and spiritual masters of the north, were drummers on campels, jugglers tossing hoes in the air, dancers galore, countless swordsmen, spear-carriers and trumpeters blowing eight-foot-long instruments worthy of Joshua at Jericho.

For five hours, one emirate after another strutted its stuff before 40,000 spectators including American U.N. Ambassador Andrew Young, six visiting African heads of state and their Nigerian host Lt. Gen. Olusegun Obasanjo.

The last major even of the month long Festival of African Culture, today's crowd-pleaser bore the marks of a native northern Nigerian love of horses, shared by the British whose influence remains palpable here more than 16 years after independence.

Obasanjo stressed in a speech that northern Nigeria had put on such pageants long before Britain's Lord Lugard arrived in the north at the turn of the century and dubbed them "durbars," in keeping with the term applied by the British Raj to somewhat similar occasions in India.

The officers' swagger sticks a group of mounted polo players, an army band playing British marches and magnificent lancers lining the parade area resplendent in their tropical topees, red coats and black trousers all bespoke a nostalgia for things British.

But it was an intrinsically northern Nigerian event that recalled the glory of ancient kingdoms revitalized in an early-19th-century jihad, or holy war by the legendary Moslem reformer Usman Dan Fodio and his Fulani warriors.

To Western eyes, the day's spectacle was reminiscent of medieval Europe: foot warriors carrying bows and arrows; brightly dressed horsemen, some in chain mail, their steeds caparisoned in silver and gold-trimmed cloth; emirs' servants busily twirling magnificent umbrellas over their masters' august heads and fanning them without interruption.

On several occasions half a dozen horsemen standing in their stirrups, their long spears at the ready, charged a like number of opponents in a galloping encounter recalling jousting.

At one point red-outfitted musketeers let loose salvos of resounding shots in the air, rudely awakening more than one dozing spectator made drowsy by the incessant rhythms of flute, drums and trumpets.

At the far end of the race course the 500 camels, 3,600 horses and their keepers emerged from the dusty haze caused by the harmattan wind that blows off the Sahara at this season. Adding a contemporary note was a horse whose rump was covered by what looked very much like an American flag.

The final group to parade was that of Dan Fodio's direct descendant, the sultan of Sokoto, traditionally considered the most powerful man in northern Nigeria. Throughout most of the day he had sat in the front row of the VIP section of the reviewing stand - just one seat away from President Carter's envoy.

Later, when the sultan and his followers approached the reviewing stand and dismounted, the entire audience rose as one man to pay him tribute.

A dazzled Westerner in the reviewing stand expressed his astonishment at the durbar by remarking, "Cecil B. DeMille, eat your heart out."