PALO ALTO — Tesla Motors reported Wednesday that it delivered 6,457 all-electric Model S sedans in the first quarter and remains on track to deliver more than 35,000 cars this year.

But the electric-car maker lost $49.8 million, or 40 cents a share in the quarter, on $620.5 million in sales. While the results beat Wall Street expectations, Tesla’s stock tumbled more than 7 percent in after-hours trading over production delays of the upcoming Model X. A year ago in the same quarter, Tesla reported its first profit.

Research-and-development costs jumped to $81.5 million as the company adapts the Model S to foreign markets where steering wheels are on the right side, such as the United Kingdom and Japan, and prepares to launch the Model X, a crossover SUV. Tesla said production of the Model X will ramp up in spring 2015, backing away from previous announcements that volume deliveries to customers would begin then.

“The Model X is being pushed out. That’s a little bit of a negative,” said analyst Theo O’Neill of Litchfield Hills Research. O’Neill has set a $280 price target on Tesla’s stock and maintains a “buy” rating.

“Momentum stocks have taken a hit lately, but overall this was a good quarter,” he said, adding that Tesla CEO Elon Musk “has to be happy with the way things are going.”

During a conference call with analysts, Musk said Tesla has signed a “letter of intent” with Panasonic to jointly build a giant “gigafactory” for batteries for electric cars. Musk also said that California is back in the running to host the gigafactory, joining four other states. But Musk added that the speed with which states can issue permits for the massive facility is key. “The main thing with California is time to completion,” he said.

Tesla in its earnings reports emphasizes “adjusted” financial information, which excludes certain costs, such as stock options, and includes deferred revenue. Adjusted revenue was $713 million for the quarter, up 27 percent from a year ago.

Tesla remains bullish about the market in China, where deliveries of its Model S began this month. A company letter to shareholders said Shanghai officials have been supportive, allowing Tesla to construct a Supercharger station within a few weeks of site selection.

“Our entry into China has been greeted enthusiastically,” Musk wrote in the letter. “We plan to expand in China as fast as possible because we believe the country could be one of our largest markets within a few years.”

Tesla is now making nearly 700 cars a week at its Fremont factory, but plans to ramp up production to 1,000 cars a week by the end of the year.

Contact Dana Hull at 408-920-2706. Follow her at Twitter.com/danahull.