A spokeswoman for the country’s rescue services said five people, including children, were injured.
Slovak media reported the attacker stabbed victims and was then shot by police running away from the elementary school in the town of Vrutky, 220 km (137 miles) northeast of the capital Bratislava.
Police said on their Facebook page they “had the situation under control”.
Slovak elementary schools began reopening on June 1 under an easing of coronavirus lockdown measures.
More about: #Slovakia