Phillip Monk, 61, of Penycoedcae, Pontypridd, went on trial at Newport Crown Court accused of 23 counts of indecent assault of a person under the age of 14, relating to seven girls.
He was found not guilty of assaulting pupils at Maesybryn Primary School, near Pontypridd, between 1984 and 1995.
No evidence was offered on six similar charges relating to two girls.
He was also cleared of these.
Judge Daniel Williams formally found Mr Monk not guilty of these charges after at a hearing on Monday after being told no evidence would be offered by the prosecution.

Enda Kenny said that the draft bill would bring certainty to pregnant women and legal clarity to doctors
He was speaking after the cabinet reached agreement on the proposed Protection of Life in Pregnancy Bill.
It includes the credible threat of suicide as grounds for a termination.
The taoiseach told a news conference on Wednesday that the issue had been "divisive and contentious" for more than 30 years.
By Shane HarrisonBBC Ireland Correspondent
Since 1983, when voters put an amendment into the constitution giving the mother and unborn child equal rights to life, doctors and medics have been operating in a grey area as to when a pregnancy can be terminated to save the mother's life as distinct from her health.
Their difficulty was compounded by the 1992 Supreme Court ruling that the credible threat of suicide - though extremely rare - was grounds for a termination.
The heads of the bill agreed last night should bring some clarity to those issues and should eventually become law given the size of the government's majority.
But Enda Kenny knows that several members of his Fine Gael parliamentary party are prepared to lose the whip because of their anti-choice views.
For them, in any pregnancy, there are two lives with equal rights at stake and they believe the suicide threat could eventually lead to abortion on demand.
That scenario is rejected by the government and pro-choice activists.
The right-to-choose campaigners say that 11 women leave the republic every day for British terminations and that situation is unlikely to change.
"This bill restates the general prohibition on abortion in Ireland. The law on abortion in Ireland is not being changed," he said.
"We are a compassionate people. This is about women; it is about saving lives, the life of the mother and the life of the unborn.
"Our country will continue to be one of the safest places in the world for childbirth."
The tanaiste (deputy prime minister), Eamon Gilmore, said there had been been a "pall of uncertainty" over the issue.
"Women have a right to know that, if the worst happens, they will be able to have life-saving treatment. For years they have been denied that right," he said.
Irish Health Minister James Reilly said for two decades governments had failed to deal with the issue.
He said the bill would "put in place a certainty about how to deal with medical emergencies during pregnancy".
The Irish government published the draft legislation on Tuesday night.
It allows for terminations when there is a real and substantial threat to the life of the mother, including the threat of suicide.
The draft bill states that terminations must be carried out in public obstetric units, except in emergencies, when a single medical practitioner can approve an abortion.
In the case of a risk of loss of life from physical illness, two doctors must certify that there is a real and substantial risk to the mother's life.
In the case of a risk of suicide, three doctors must jointly sanction an abortion - an obstetrician and a psychiatrist from the hospital involved, and another psychiatrist.
If a woman is refused an abortion, she can appeal to a committee, which must meet within seven days of her request, and report within another seven days.
The bill will be discussed by the health committee.
Legislation will then be drawn up and introduced in the DÃ¡il (Irish parliament)
At present, at least 11 women leave the Irish Republic every day for an abortion in Britain.
A primary school teacher accused of indecently assaulting his pupils has been cleared of all charges.
[NEXT_CONCEPT]
A controversial abortion bill in the Republic of Ireland does not amount to a change in the law, the Irish prime minister has said.