By Sebastian Herrera and Katy Stech Ferek

A federal judge in California temporarily blocked the Trump administration's executive order curbing Americans' use of WeChat, upholding a motion from users of the popular Chinese-owned messaging and e-commerce app.

U.S. Magistrate Judge Laurel Beeler entered an order Sunday for a preliminary injunction blocking the federal ban on U.S. downloads and other functions from going into force as scheduled for 11:59 p.m. Sunday.

The ruling is a victory for WeChat's owner, Chinese tech giant Tencent Holdings Ltd., and the U.S. WeChat Users Alliance, the nonprofit organization representing several mobile app users that filed the motion against the Trump administration in August. The group, which has said it isn't affiliated with Tencent, said it consists of users who rely on WeChat for business and personal reasons.

In her 22-page order, Judge Beeler agreed with free-speech arguments raised by the user groups, saying she is convinced that "there are no viable substitute platforms or apps for the Chinese-speaking and Chinese-American community."

"WeChat is effectively the only means of communication for many in the community, not only because China bans other apps, but also because Chinese speakers with limited English proficiency have no options other than WeChat," she said in the order.

The mobile app, which has 19 million regular users in the U.S. and more than 1.2 billion users world-wide, enables users to send messages, make phone calls, transfer money. It also functions as a social-media platform, and is widely used by companies in China -- including U.S. companies operating there -- for business communications and marketing.

The Trump administration contends that the data that WeChat collects from U.S. users could be shared with the Chinese government. The company disagrees, saying it "incorporates the highest standards of user privacy and data security."

Judge Beeler said that, while the U.S. government's concerns about the national security threats are significant, "the specific evidence about WeChat is modest."

A spokesman for Tencent said it was reviewing the judgment and didn't immediately comment.

Representatives for the Commerce Department, which was preparing to implement the order, didn't immediately respond to a request for comment.

The Commerce Department issued regulations Friday that explained how it would carry out President Trump's Aug. 6 order to ban U.S. companies from providing app downloads or updates for WeChat and another Chinese-owned app, TikTok, on Sunday night.

On Saturday, the department put the TikTok ban on hold, citing progress on a deal that would add national-security safeguards for the video-sharing app's U.S. users.

President Trump said he has agreed in concept to a deal under which TikTok will partner with Oracle Corp. and Walmart Inc. to become a U.S.-based company, capping negotiations that have stirred debate over national security and the future of the internet.

On WeChat, the Commerce Department's order also would ban money transfers in the U.S. using the app, and bar companies from providing data-hosting services for WeChat. The restrictions would essentially make the app unusable over time even for those who have already downloaded it.

The order, however, allows U.S. companies to continue using WeChat outside of the country -- a critical point because many American businesses that operate in China use WeChat to do transactions with their customers there.

WeChat's domestic sister app Weixin is dominant in China, where it is used to communicate and to shop and pay for everything from restaurant meals to major purchases. WeChat in the U.S. has also become important among Chinese Americans who use it to communicate with family and friends overseas.

Lawyers representing the WeChat Users Alliance sued the Trump administration on Aug. 21 over the ban. They have argued that the executive order violated users' First Amendment rights, and that the government hadn't provided sufficient evidence of WeChat's negative effect on national security. Plaintiffs have also said the order discriminately targets Chinese Americans.

A ban would "cut off communications not only between millions of people in the United States with each other but also communications with friends, families, and businesses in China and the rest of the Chinese diaspora that rely on WeChat," lawyers representing the alliance wrote in a filing before a hearing in the case on Saturday.

U.S. government lawyers have said the ban doesn't infringe on First Amendment rights of WeChat users because users have alternative options for communicating.

WeChat "is well recognized as working to advance the Chinese Government's aims over propaganda, censorship, surveillance and misinformation both inside and outside China," government lawyers wrote in a court filing. They have said they wouldn't pursue legal action against individuals who use WeChat for personal or business purposes.

Tencent on Friday said it planned to continue discussions with the government and stakeholders on how it could continue providing services to U.S. users. The Asian tech giant has played down the threat of the U.S. ban, saying it would only apply to the international version of its app.

Write to Sebastian Herrera at Sebastian.Herrera@wsj.com and Katy Stech Ferek at katherine.stech@wsj.com