A Sats paper was taken by 600,000 children aged 10 and 11 in England despite answers being mistakenly published online the night before.
The grammar, punctuation and spelling test answers were shown on a password-protected website for test markers for a couple of hours on Monday night but were later taken down, schools minister Nick Gibb told MPs.
The government says it then thinks someone who's against the tests, tried to make them public. They're now looking into what happened.
The test went ahead as normal because officials don't think it was seen by any parents or children.
The new Sats have been controversial, some parents and teachers have said they are too difficult and put too much pressure on pupils.
The government says that tests give children the skills they need to succeed and should not be a cause of stress for pupils.
It is the second time in three weeks a primary school exam has been published online.
The government was forced to scrap a test for half a million children aged six and seven after it was posted accidentally with practice materials three months early.