The city justified the move on the grounds that Lime, Wind and VOI were not doing enough to inform people of their usage rules.
Lime, which is partly owned by ride-hailing Uber and Google parent company Alphabet, and the other two firms distributed electric scooters across the capital earlier this year without official authorisation.
Their arrival has forced Madrid and other Spanish cities to regulate the new trend.
In the capital, the scooters are banned on pavements and in pedestrian zones but authorised on all roads where the speed limit is 30 kilometres (19 miles) an hour — a limit implemented recently on 80 percent of the city's streets.
The three companies can “at any moment” submit a new request for a licence, Madrid's city hall said in a statement Tuesday, adding that a total of 18 companies have expressed interest in providing the service.
Contacted by AFP, California-based start-up Lime which has distributed the most scooters in Madrid, did not immediately react to the city's decision.
Barcelona, Spain's second-largest city which is overwhelmed by mass tourism, already bans the use of shared electric scooters. Under its rules, anyone paying to use a scooter must be accompanied by a guide.
Similar electric scooter-sharing programmes have been introduced in other European cities including Paris, Vienna and Zurich.
Unlike schemes involving shared bicycles that typically must be left in docking stations, the scooters are dockless, leaving riders responsible for parking them securely.
The next rider can find the nearest scooter with a smartphone app, unlock it and use it for a fee.