Embarrassment, alarm and confusion undulated across the United States and Canada in powerful waves Thursday, as thousands upon thousands of cellphone users unlocked their phones to the baffling revelation that they had either sent or received an eerie, contextless text message while sleeping.

The messages — more than 168,149 of them — appeared from jilted lovers and distant acquaintances. They were sent to close family members and former co-workers. A channel of communication had been opened between the living and the dead. There were odd questions, admonishments and references to plans that did not exist. Some people received nonsensical instructions; others, unexpected compliments. Outside, gold and carmine leaves glowed against the autumn sky. Inside, on phone screens, the message, for many, was simply: “Happy Valentine’s Day!”

While some mystified recipients replied to the messages for clarification — creating only more mysteries, since the senders’ phones indicated that no messages had been sent — others sought answers from the world. Twitter, Reddit and Facebook were inundated with posts from hundreds of people wondering, nervously, if they were the only person it had happened to. (In a foretaste of a social media-era Rapture, the platforms were also flooded with posts from disappointed users wondering why it had not happened to them.)

Allison Candler, an attorney in Atlanta, was getting ready for work when her husband, Clark, asked, “Why did you text me ‘Am I gonna get sued for sexual harassment?’ at 4:45 in the morning?”

“Of course, I was fairly shocked,” said Ms. Candler, who had no memory of asking that question, and whose phone showed no evidence she had. “I sat down then and there and changed all of my passwords, thinking maybe my iCloud account had been hacked.”

Later that day, she said, after her husband alerted her to the widespread phantom text confusion spreading online, “I thought, ‘Did I actually send that text?’” By this point, large numbers of people had deduced that the texts sent from their phones were ones they had, in fact, tried to send — many of them on Feb. 14 — but that had, without their knowledge, taken months to deliver. This realization stirred Ms. Candler into what she described as a “paranoid frenzy.” She began asking “everyone I had seen if they’d gotten a weird text from me in the middle of the night,” she said.

A search of her conversation history eventually revealed the subject of her text: a long-forgotten email fiasco. While attempting to thank a friend for buying lunch, she had accidentally sent a heart emoji to a male co-worker, told him he was “the best,” and wished him “Happy Valentine’s Day!”

At the time, Ms. Candler said, her note to her husband would have been “clearly a joke” and “totally unremarkable” — in the middle of the night, three-quarters of a year later, however, it was “slightly alarming.” (Mr. Candler said that when he found the message Thursday morning, he assumed his wife had woken up confused, in the midst of a nightmare, and texted him.)

While mix-ups like the Candlers’ were quickly resolved, other messages, like the two Desiré Davis-Dunmire, a computer technician in Hampton, Va., received from her husband Connor, caused anguish.

“Omw home,” read the first, sent at 4:49 a.m. from Mr. Dunmire’s phone. (“Omw” is a text message abbreviation for “on my way.”) Mr. Dunmire is currently stationed at sea with the United States Navy; his wife did not expect him back until the end of the month, around her birthday. Minutes later, another arrived: “Cuz I’ll be coming home with your present.”

“I was immediately filled with joy,” Ms. Davis-Dunmire said, describing waking up to the texts. A screenshot of the exchange shows her writing back with giddy disbelief at 7:02 a.m. (Ten minutes later, she replied with another burst of affection: “Yaaaaaaaay!! Xxxxxx.”) She got out of bed right away, she said.

“I was so excited that I just started to deep clean my house. I wanted everything to be spick and span for his arrival so that there was nothing that needed to be done, and we could just cuddle and enjoy being reunited.”

For the next few hours, her husband’s arrival seemed imminent. (“I did a lot of hard work from the time I got those texts,” she said.) At 9:57 a.m., without a reply from him, she sent another message: “I DONT UNDERSTAND BUT IM EXCITED.” It was past 11 a.m. when she checked her social media feeds. As she read other people’s stories about phantom texts, she realized her phone had been affected.

“Honestly,” she said, “I cried. Because I was so excited to see my husband again, and it crushed me that it wasn’t even an actual text.”

After Ms. Davis-Dunmire posted about her experience in a private Facebook group, another member shared her story with a Verizon customer service representative via Facebook messenger.

“We apologize for any confusion the recent messaging issue may have caused you,” the representative wrote to the member who had shared Ms. Davis-Dunmire’s story. “We want to make sure this apology is extended to your friend as well.”

“I know how exciting it would be to have a loved on [sic] returning from duty,” wrote the representative. “I hope that they do return home safely to their family.”

The major telecommunications companies were slow to address the confusion Thursday morning, and loath to accept blame once they did. Vague company statements began trickling out: “Last evening, a maintenance update occurred to part of the messaging platforms of multiple carriers in the U.S., including Sprint, which caused some customers to have older text messages resent to their devices,” said Sprint in an email.

What was unclear, and what the company statements did not address, was what, exactly, had caused them to mass-deliver in the dead of night, which and how many people were affected, and why, without their authors’ consent, the content of private messages appeared to have been stored in the ether for months.

Data compiled by the Department of Justice in 2010 for the use of law enforcement indicated that, of the four major American cellular service providers, only one retained records of the actual content of text messages for any length of time: Verizon, for a period of 3 to 5 days. The content of texts sent via T-Mobile, AT&T and Sprint was described as “not retained.”

On Thursday afternoon, after many unreciprocated emails were sent to carriers, a spokesman for Verizon suggested that the answer might lie with a third-party text message service provider called Syniverse Technologies, in Tampa, Fla.

Was Syniverse the vendor responsible?

“You really need to ask them that,” the Verizon spokesman said.

Syniverse describes itself as “the world’s most connected company,” and says it has developed “the largest private network ever built for linking to the mobile ecosystem.” It is difficult, if one is not fluent in telecom jargon, to even guess at what it does from its website.

Late in the afternoon on Thursday, a spokesman for the company, Kevin Petschow, said in an email: “During an internal maintenance cycle last night, 168,149 previously undelivered text messages were inadvertently sent to multiple mobile operators’ subscribers.”

Mr. Petschow initially would not comment on whether those text messages had been sent on Valentine’s Day. But Syniverse later posted a statement to its website saying that on Feb. 14, one of its servers had failed. That server was reactivated on Thursday, causing messages that had been stuck in transit to flow outward to the phones of loved ones, exes and all the rest.

Syniverse’s statement said:

Messages that cannot be delivered immediately are temporarily stored between 24 to 72 hours depending upon each mobile operator’s configuration. During this time, multiple delivery attempts are made. If the message remains undeliverable after the specified time, the message is automatically deleted by Syniverse.

For all messages, the content of the message is deleted, and only the metadata for the message is stored for 45 days. Messaging metadata includes the operator and device identification information. We retain the metadata for billing and reporting purposes only.

Mr. Petschow did not respond to a question about why the Valentine’s Day texts had been preserved for so long. Had they frozen in transit?

Paul De Sa, a telecom industry analyst and founder of the advisory firm Quadra Partners, explained that Syniverse provides infrastructure for communication between major carriers, a kind of carrier for the carriers.

If a message needs to go from a Sprint phone to a T-Mobile phone, for instance, it’s likely that Syniverse is enabling its travel. “Basically, they do the plumbing behind the telecommunications companies,” Mr. De Sa said.

In a 2015 interview with the Tampa Bay Times, Stephen Gray, then the chief executive of Syniverse, told the newspaper that it wanted to be at the cutting edge of the adoption of LTE, then the newest thing in mobile. It also planned to help companies in other industries — from airlines to hospitality — send texts to customers’ devices.

Mr. De Sa said that it was entirely possible that the messages on the server that crashed had essentially frozen in transit, and had been restored only when the server came back online.

He laughed, though when told that the 168,149 messages had been stored on a server that crashed in February, and that they had only been delivered the previous night. “No one noticed?” he joked.

On Friday afternoon, Syniverse emailed an updated statement to convey the company had underestimated the number of messages that were sent.

“As we’ve pursued additional analysis and review, we have determined that the initial number of person-to-person (P2P) messages released is higher than initially reported,” the statement said. “We are continuing to work with customers to understand and communicate the scope of the incident and apologize for this inaccuracy.”

Restrictions on personal cellphone usage aboard Navy vessels, coupled with a lack of cellphone service at sea, mean that Ms. Davis-Dunmire’s husband may not receive her responses to his phantom texts — including a follow-up message she sent, explaining the confusion — for weeks.

Asked to predict his eventual reaction when a deluge of unexpected texts pours into his phone, Ms. Davis-Dunmire said, “I’m sure he will be pretty puzzled.”