The prime minister was arrested after the coup but released on August 11 by the new military junta led by General Mohamed Ould Abdel Aziz.
The reasons for the latest arrest of the prime minister are not known.
It comes after Ould Ahmed Waqef told Abu Dhabi TV on Wednesday the president had tried to fire the generals after learning they were "preparing a coup to be carried out on August 9."
Resisting the coup
The ousted prime minister last week said he would not recognise the nomination by the junta of former diplomat Moulaye Ould Mohamed Laghaf as his replacement and would not willingly hand over his post.
The ousted president Sidi Ould Cheikh Abdallahi is still being detained by the authorities, under house arrest in a villa on the grounds of the Nouakchott congress centre.
On Wednesday the Mauritanian parliament started a month-long special session led by a majority of 107 of the total of 151 deputies who support the coup.
The session was officially called to discuss "the reasons for the blockage of democratic institutions" which led to what the general's supporters are calling "the change" of August 6.
However the pro-coup deputies have said they will use the session to name eight members to a special high court of justice, which could decide to put Ould Cheikh Abdallahi on trial.