The Bolivarian National Intelligence Service (Sebin) was ordered to arrest Lopez for violating his initial house arrest of 13 years, of which he has only served approximately five, to help carry out Tuesday's coup attempt of the Venezuelan government.
The Caracas court is ordering Lopez to carry out the remainder of his sentence in the Ramo Verde National Military Center.
Lopez also violated his original sentence by talking to the media during Tuesday's failed overthrow.
The 48-year old politician was a leading figure in the 2014 far-right violent demonstrations against President Maduro. He was sentenced in 2015 for inciting violence and killings during the protests. Lopez was initially sentenced to carry out his sentence in prison, but was later released to house arrest in 2017.
The opposition leader was illegally freed Tuesday and was seen at Altimira highway meeting with the self-declared interim president Juan Guaido and the 30-40 defected soldiers. That evening, Lopez entered the Chilean embassy in Caracas, but later moved to the Spanish embassy where he remains.
teleSUR correspondents in Caracas are on standby in front of the Spanish embassy to deliver further information.