The price of bitcoin jumped to a six-week high Monday, with some investors attributing the rally to short positions being liquidated and speculation that Amazon. com Inc. may be venturing into digital currencies.

Bitcoin soared as high as $39,544.29, according to CoinDesk, reaching its highest level since mid-June. It is up 18% from its 5 p.m. ET level Friday, after briefly rising more than 20% earlier Monday morning. Rival currency Ether jumped more than 14%.

Recent bullish comments from high-profile proponents of cryptocurrencies have helped buttress the price gains. Last week, Tesla Inc. Chief Executive Elon Musk said he and his rocket company, SpaceX, held bitcoin, despite concerns about its environmental impact. Mr. Musk also said Tesla would likely accept the cryptocurrency as payment again if the process of generating it, known as mining, becomes less reliant on fossil fuels.

“There’s been a lack of good news in the cryptocurrency market in the last two months,” said Bobby Lee, founder and CEO of Ballet, a cryptocurrency hardware wallet. “Now they’re starting to trickle out, so investors and speculators are using this opportunity to build up their positions and buy back bitcoin, causing the price to rise pretty dramatically.”

Bitcoin is still about 40% below its high of nearly $65,000 in mid-April. The following month, China’s renewed efforts to crack down on bitcoin mining and trading contributed to sharp price declines.

In recent days, speculation grew over Amazon’s possible plans for cryptocurrencies and related technologies, after the company posted a job opening for an expert in digital currency and blockchain.

The online retailing and cloud-services giant said the person, who would be on its payments team in Seattle would be charged with developing “Amazon’s digital currency and blockchain strategy and product road map.” That led to online chatter that the company could one day enable customers to pay in cryptocurrencies. Amazon didn’t immediately respond to a request for comment.

Related Video

China’s recent warning on cryptocurrency sent the market in a tailspin. WSJ’s Aaron Back explains why the recent shake-ups in the value of bitcoin, dogecoin, ether and other cryptocurrencies may point to obstacles in mainstream acceptance. Photo: Dado Ruvic/Reuters The Wall Street Journal Interactive Edition

Some $740 million worth of short positions in bitcoin were liquidated Monday, according to data from Bybt, the most of any day in the past three months.

Many cryptocurrency exchanges enable their users to bet on price declines by entering into short positions in their margin-trading accounts. As with stocks, traders do so by borrowing cryptocurrencies such as bitcoin—sometimes with leverage, or borrowed money—and selling them before repurchasing at a lower price to repay their lenders.

Mr. Lee said that when prices jump unexpectedly—especially with cryptocurrencies, where there is a large amount of futures and other derivatives trading—traders with short positions are caught, causing what is known as a short squeeze and leading the price to rise even higher.

Claire Wilson, a partner at Singapore-based consulting firm Holland & Marie, said volatility in the crypto market, caused by a variety of factors, is nothing new. “However, over the past few months, these wild price swings are more frequently linked to comments by personalities on social media,” she said.

Write to Elaine Yu at elaine.yu@wsj.com and Caitlin Ostroff at caitlin.ostroff@wsj.com