Police used nightsticks and tear gas last night to disperse about 30,000 demonstrators in the northern industrial city of Monterrey who were protesting alleged vote fraud in the July 7 elections.

The unrest highlighted lingering discontent over the midterm elections among supporters of the conservative National Action Party, the nation's largest opposition grouping. National Action had hoped to win its first state governorships in the border states of Sonora and Nuevo Leon, of which Monterrey is the capital. But candidates of the ruling Institutional Revolutionary Party (PRI) were declared the victors in elections marred by widely reported irregularities.

State and city police broke up the rally in Monterrey's main plaza after some protesters threw rocks, bottles and sticks at the police and at the state governor's palace, according to state officials, witnesses and Mexican newspaper reports. The demonstration had been called by National Action to protest Wednesday's inauguration as governor of the PRI's Jorge Trevino.

The state government reported today that 22 civilians and 17 policemen were treated for injuries following the disturbances. Three of the civilians were hospitalized with serious wounds, including one man who was believed to have a fractured skull, the Red Cross said. Seven persons were arrested, according to local newspapers, although police declined to confirm that anyone was detained.

The unrest in Monterrey was the most serious since election day. National Action leaders have urged their supporters to avoid violence, and last night's trouble broke out after National Action's losing gubernatorial candidate, Fernando Canales Clariond, had urged the crowd to remain peaceful.

Although it lost the two state governors' elections, National Action won a record number of races for seats in the national Chamber of Deputies. The Federal Electoral Commission declared that National Action won six seats, compared to only one in the 1982 elections.