The letter from Mr Logan to councils last week said children could only be withdrawn in “exceptional circumstances” and stated that advice had been taken from the Society of Local Authority Lawyers in Scotland (Solar) - which was later disputed by the organisation.

Conservative MSP Liz Smith asked whether Mr Swinney had personally signed off the letter, which she said had contained “misleading” information.

He responded: “I did not sign off the letter that was issued by the deputy director to directors of education but I take full responsibility for it because I’m a minister in the Scottish Government and it’s right that I take full responsibility for it.

“We did not seek legal advice from Solar. We discussed the legal position that we hold to, which has been consistent throughout all of the government’s communication on this matter, we discussed that with representatives of the Solar organisation but ... an error was made in our handling of this in that we expressed a view which we believed to have been expressed by Solar, but which in fact Solar does not express such opinions.

“I can only apologise to Parliament ... for the events that took place in that respect, but I take responsibility for it because I should take responsibility for it.”

He stressed that the substance of the letter was consistent with the Scottish Government’s position - that while there is no statutory right for parents to withdraw their child from any aspect of schooling other than some parts of religious education, they could discuss the matter with the school.

Mr Swinney, who has already announced changes to the P1 tests in response to concerns, said he remained committed to them as they provided valuable information for teachers.

“I want that information to be available so that at the earliest opportunity we can act to close the attainment gap,” he said.

Green MSP Ross Greer urged Mr Swinney to “cut his losses”.

“In the case of P1 tests it’s quite clear that a majority of this parliament want to see them go and sooner or later that is what we’re going to vote for,” he said.

Labour’s Iain Gray said: “Faced with the evidence of stress on four and five-year-olds caused by these tests, testimony from teachers that they are time-consuming and of little educational worth, and a campaign by parents to boycott them, he is carrying on regardless.

“In P1, at least, they should be suspended. I believe that’s the view of this parliament and I hope we will have the chance to demonstrate that as soon as possible.”

Lib Dem Tavish Scott urged Mr Swinney to “reflect on the fact that he hasn’t carried the case in terms of four and five-year-old girls and boys”.

Trending

9 lesser-known Scottish towns and villages that are worth a visit

Celtic sign Andrew Gutman, close in on deal for third American starlet

Rangers: The market value of all 28 players in Steven Gerrard’s £41m squad

Scottish Premiership: The market value of every squad in the league - and the total is nearly £200million