Vote counting has been halted in Puerto Rico's hotly contested gubernatorial election following charges of vote fraud and after violence broke out in which one youth was killed. Even so, early returns indicated the islanders were rejecting the idea of applying to be the nation's 51st state.

Gov. Charles Romero Barcelo, who had been endorsed by President Carter in his pro-statehood drive, was trailing his challenger, former Governor Rafael Hernandez Colon, by 725 votes out of nearly 1.6 million cast when the commonwealth's election commission halted the tally late Wednesday night. The Independence Party candidate, Ruben Berrios, was far behind with less than 7 percent of the vote.

Hernandez Colon, who supported a continued commonwealth status for the island, charged in an emotional speech from the San Juan suburban headquarters of his Popular Democratic Party that Romero was tampering with the ballots and urged his followers "into the foxholes" to prevent fraud. "We will not allow this election to be stolen," he shouted.

An angry crowd of several hundred persons then marched and drove about four miles to Roberto Clemente Stadium where precinct tallies were being added and lay siege, shouting slogans equating the governor with assorted Latin American dictators. "Romero and Somoza are the same thing," they yelled, referring to ousted late Nicaraguan President Anastasio Somoza.

A number of rocks were thrown at riot-equipped police and one truck attempted to crash through an entrance, but police held firm and eventually dispersed the crowd. The uncounted ballots were then moved to the downtown election commission offices.

An aide in the Washington office of Puerto Rico's resident commissioner said a computer breakdown had forced precinct tallies to be counted by hand, and that the persons contracted to do the counting had asked for some time off to sleep. The count would resume today on the 56,000 ballots remaining, he said.

Hernandez Colon and Romero both claimed victory even before the polls closed and their supporters paraded through the streets in gaily decorated vehicles, honking horns and shouting. Police said the shooting occurred early Wednesday evening when a Romero supporter opened fire on one of the cars emblazoned for Hernandez Colon, killing Freddy Betancourt Baretty, 14. Another occupant of the car was wounded in the leg.

Police jailed Carmelo Gomez Santiago, 53, in lieu of $68,000 bond.

The silver-haired Romero told a televised rally of his New Progressive Party that he would be the winner when all ballots are counted because of projections from past absentee voting. He had run on a statehood-now platform but announced that because of the narrow count he had decided to cancel his plans to hold a referendum next summer on the island's future.

His decision effectively ends the PNP's long campaign to drum up enthusiasm for statehood among this impoverished island's 3.5 million residents. Although the islanders are American citizens under the commonwealth arrangement, they can vote only in U.S. primary elections, have no voting representative in Congress and did not cast ballots for president. Nonetheless, all the major candidates including Ronald Reagan had pledged to support the results of any referendum that would be held on the status question.

Hernandez Colon has insisted that Puerto Rico would be bankrupted by statehood and humiliated by applying for it since the Senate would be sure to reject the idea of taking in so many Spanish-speaking, poor, largely Democratic voters, not all of whom want statehood in the first place. Instead, he said, the island needed a rejuvenated form of the 50-year-old commonwealth status that would provide more benefits while allowing Puerto Ricans to retain their cultural identity.

Hernandez Colon challenged 18,000 of the uncounted ballots and claimed victory in his Wednesday speech.