Hundreds of thousands of mostly middle-class Spaniards thronged central Madrid today to stage a massive demonstration against the Socialist government's educational policies.

The protesters, who included fur-coated matrons, priests and nuns as well as parents, teachers and pupils, took more than three hours to cover a two-mile route along the broad, tree-lined Paseo de la Castellana thoroughfare.

They moved slowly and in silence, braving cold wintery showers, and heard recordings, broadcast through loudspeakers, of Pope John Paul II referring to the defense of church schooling.

It was the biggest protest demonstration mounted to date against the government, which is midway through its four-year term. City police said that about 250,000 had taken part in the march while the organizers said the demonstrators numbered 1.2 million. The independent local press agency Europa Press estimated 700,000 protesters.

At issue is a legislative package, approved by the Socialist majority in the legislature, that establishes controls and guidelines over the state funding of private schools, the majority of which are run by religious orders.

Critics of the bill accuse the Socialist government of undermining nonstate education in general and Catholic schooling in particular in this predominantly Roman Catholic country of 38 million.

The legislation is being reviewed by the constitutional court, which has accepted a claim by the conservative opposition that the bill could contravene constitutional guarantees over the freedom of education.

The government says a measure of control over public funding of nominally private schools is necessary and that the legislation protects the current mixed system by assuring the religious orders of state grants. Under the Socialist administration, more funds have been made available for private schools in an effort to raise educational standards.

The march was organized by the Confederation of Catholic Parents and by the Association of Catholic Teachers, who arranged more than 5,000 special buses and chartered trains and flights to Madrid.

Organizers claimed that a number of buses had been turned away from Madrid on the highways by police, and the authorities countered that the police were implementing spot checks on new safety regulations for road transport.

The demonstration invited comparisons with a similar major protest staged last June in Paris that was backed by French conservative politicians and bishops and that led to the withdrawal of educational measures proposed by the Socialist government there. The Paris demonstration is believed to have accelerated the subsequent removal of prime minister Pierre Mauroy.

Spanish political commentators predict no such political fallout. Opinion polls show that although Spain's Socialists have slipped in popularity, they still hold a commanding lead over the conservative Popular Alliance.

The demonstration nevertheless was indicative of a growing middle-class restlessness. Aside from the education issue, there has been increasing criticism of rising city crime and drug abuse, which is attributed to allegedly lenient penal policies introduced by the Socialists.

The Bishops' Conference, the governing body of the Catholic Church in Spain, and the Popular Alliance maintained a relatively low profile in today's protest and only implicitly backed it. In Paris, the protest was lead by bishops and opposition leaders.

In Madrid, the head of Popular Alliance, rightist Manuel Fraga Iribarne, and other conservative politicians mingled with the the crowd.