Tesla Motors unveiled a system that will let drivers swap out the battery in a Model S in about 90 seconds, which is less time than it takes to fill up a traditional car at the pump.

Tesla hopes the new system will help overcome the fears that many drivers have about the convenience of electric cars.

At a demonstration in California Thursday night, Tesla CEO Elon Musk said the battery swap stations will be installed throughout the network of "supercharging" stations that Tesla is already building around the nation. The supercharging stations currently provide free recharging in about an hour. Musk said the battery swap, which will cost at least $50, will allow drivers a choice in order to get back on the road faster.

"The only decision you need to make when you come to one of our Tesla stations is, do you prefer faster or free," he said. "Our goal here was to eliminate the objections that people have. We want to show that [Tesla] can actually be more convenient than a gasoline car. Hopefully this is what convinces people that electric cars are the future."

During Tesla's demonstration of the Model S battery swaps, a video screen above the swapping station showed a driver taking 4 minutes to fill up at the pump.

It cost $99.83 to fill up the car's 23 gallon tank at an L.A. gas station. Most gas tanks hold around 15 or 16 gallons.

Related: 9 questions for Tesla's Elon Musk

The swap is done by the same machine used on the assembly line, which senses the location of the bolts that hold the battery in place, unscrews them and then lowers the old battery into the ground and raises the new battery into place, reattaching the nuts to factory specifications.

According to analyst Trip Chowdhry of Global Equities Research, the quick-charge stations will be a money maker for Tesla, which plans to spend about $100 million installing the stations. Each swapping station will cost Tesla about $500,000 to install.

"We estimate Tesla margins on battery swap stations could be north of 60%," he said.

Company spokeswoman Shanna Hendriks wouldn't comment on the profit margin. But unlike the high-speed supercharging, Hendriks said Tesla intends to make money on the battery swaps. But she said the company's main purpose for offering the service is to make drivers more comfortable with the idea of taking trips in their Tesla, not to generate profits.

Drivers who opt for the swap will have to eventually return to the station to get their original battery back, and they'll have to pay for the service once again.

If they don't return, they can pay to have the 1,000-pound battery shipped back to the service center nearest their home, or they can keep the new battery they've had installed, a battery's efficiency varies depending on its age. It is expected that the swapping stations will be able to serve all future Tesla models, but not its original car, the Roadster.

The battery swapping technology also gives Tesla additional environmental credits from states such as California, which are pushing automakers to sell more zero-emission cars. Tesla has been able to sell those credits to the major automakers, and that has been a significant source of profits for the company.

One start-up that also planned to offer battery swapping for electric vehicles, Better Place, recently filed for bankruptcy and halted its operations. Chowdhry said that company's plans were based on the flawed assumption that all the different electric vehicles would use interchangeable batteries.

Related: Tesla tripling supercharger network

In May, Tesla announced plans to greatly expand its existing supercharging network, tripling the number of stations by the end of this month. By the end of this year, Tesla plans to have more than 100 locations, allowing drivers to drive from Los Angeles to New York.

Some battery swapping stations are expected to be in service by the end of the year along the San Francisco to Los Angeles corridor. Eventually they will be at all supercharging locations, though there is no schedule yet for when that will be accomplished.

Shares of Tesla (TSLA), which have nearly tripled in value so far this year, were up in early afternoon trading.