An ancient and colorful rite usually enacted in Rome took place at St. Matthew's Cathedral here yesterday when Cardinal Agostino Casaroli, the Vatican secretary of state, ordained a counselor at the Apostolic Nunciature here as an archbishop of the church's elite diplomatic corps.

Casaroli, who ranks second in the worldwide hierarchy after Pope John Paul II, ordained Msgr. Eugenio Sbarbaro an archbishop.

That rank is called for by Sbarbaro's appointment last month as papal pro-nuncio, or the equivalent of ambassador, to the south central African nations of Zambia and Malawi.

This was the first time such an ordination has taken place in this country, according to Casaroli, who heads the Vatican's diplomatic corps of about 80 ambassadors.

More than a dozen bishops and archbishops, two cardinals and several score of priests from the Washington Archdiocese took part in the more than two-hour ceremony.

After the opening hymns and scripture reading, Casaroli, flanked at the main altar by Washington Archbishop James A. Hickey and Archbishop Pio Laghi, Vatican pro-nuncio to this country, posed a series of ritual questions to the candidate standing before him.

"Are you resolved to be faithful to your duty as a successor to the Apostles?" he asked. Sbarbaro, as he had done to all the other queries, replied with a firm "I am." In the Catholic Church, the bishops are considered the spiritual successors of Christ's original apostles.

The most solemn moment of the ordination service took place in complete silence as Casaroli, followed by the other bishops, placed hands on the head of the kneeling Sbarbaro, thus forging another link in the centuries-old apostolic succession.

During the prayers for the new archbishop, Cardinal Patrick A. O'Boyle, 89, who retired as archbishop of Washington in 1973, caused some concern when he slumped at the kneeler where he and Cardinal John O'Conner of New York were kneeling, at the right of the main altar.

Priests and aides quickly gathered around him and helped him back into his chair, where he regained his composure and remained for the rest of the service.

Sbarbaro, 51, served for seven years as a priest in his native Italy before entering the Pontifical Ecclesiastical Academy, the Vatican's school for diplomats.

He served in Paraguay, Uruguay and Turkey before being assigned here six years ago. As counselor, he functioned as charge d'affaires at the pro-nunciature here during Laghi's frequent travels away from Washington.

Sbarbaro's ordination coincided with Casaroli's trip to this country for the 40th anniversary celebrations at the United Nations. In addition, aides said that many of Sbarbaro's relatives live in this country. Two brothers who are priests in Italy took part in yesterday's rites.