The High Court in the Western Cape has set aside the suspension of Busisiwe Mkhwebane on Friday.
However the order will have to be confirmed by the Constitutional Court before it is enforced.
The President suspended Mkhwebane in June.
She later took to social media suggesting Ramaphosa was gunning for her because of her investigation into the theft at his Phala Phala farm, Glencore and other scandals.
She has always maintained that her suspension was rushed and unlawful.
Meanwhile, a Parliamentary inquiry into her fitness to hold office is continuing.