After an intense 48-hour search, a missing 9-year-old girl who disappeared over the weekend while on a camping trip with her family in upstate New York was found safe Monday evening, and a suspect was in custody, according to the New York State Police.

The girl, Charlotte Sena, went missing during an early evening bike ride on Saturday in Moreau Lake State Park, about 45 miles north of Albany. Soon after her disappearance, Charlotte’s bike was found, leading authorities to conclude that she had been abducted — a scenario that the state’s governor, Kathy Hochul, called “every parent’s nightmare.”

In a late night news conference on Monday, Ms. Hochul identified the suspect as Craig Nelson Ross Jr., 47. She said that the case began to break before dawn on Monday morning, when state police, monitoring Charlotte’s family home in nearby Greenfield, N.Y., noticed a car approach and someone — believed to be Mr. Ross — placed a ransom note in the mailbox.

Troopers retrieved that note and managed to draw a fingerprint off it, the governor said. That fingerprint was linked to an arrest in 1999 of Mr. Ross for driving while intoxicated.

Hours after the fingerprint match, law enforcement officials descended on the home of Mr. Ross’s mother in nearby Milton, N.Y., where he was living in a camper behind the residence. Law enforcement raided the camper and apprehended Mr. Ross, the governor said.

Then the officials found Charlotte, hidden in a cupboard.

“She knew she was being rescued,” the governor said. “She knew she was in safe hands.”

Charlotte was in good health and had been taken to a hospital for evaluation, Ms. Hochul said. No charges had yet been filed against Mr. Ross, but were expected to be soon, she added.

In an earlier release, the state police said that troopers had identified the suspect as “being in the area of the Moreau Lake State Park around the time Charlotte went missing.”

The governor praised the efforts of the state police as well as “all who worked so tirelessly to find Charlotte.” Some 400 law enforcement officers and other personnel had joined the search, including park rangers and private companies, as well as the F.B.I.

“It just feels like a miracle that little Charlotte is safely reunited with her parents,” Ms. Hochul said in an interview with Spectrum News earlier on Monday.

Charlotte’s disappearance had frightened parents nationwide, even as experts have cautioned that kidnappings by strangers are rare. The circumstances had echoes of the 1996 kidnapping and murder of Amber Hagerman, another 9-year-old girl who was snatched by a man while riding her bike in the Dallas area.

Amber’s death was the inspiration for Amber Alerts, which broadcast information on a variety of mediums about children who are deemed to be in imminent danger. In Charlotte’s case, such an alert was issued Sunday morning, even as New York authorities were scouring the park, using bloodhounds, aerial units and boats, which searched the park’s small lake with sonar.

Before her discovery, Charlotte’s family had pleaded with the public to share her photo widely in hopes of finding her, even as reporters and rescuers descended on the park, a popular area, with dense forest and undergrowth, and a small lake.

“Any information would help,” said Jené Luciani-Sena, Charlotte’s aunt, in a video posted to TikTok on Sunday night.

Authorities also seemed eager for assistance, putting out a lengthy release just hours before Charlotte was found, asking for tips. “No detail is too small when searching for a missing child,” it read.

The details of Charlotte’s disappearance were harrowing: She was last seen riding bikes with friends on a small loop road inside the park — ringed by campsites — at a little after 6 p.m. on Saturday. Charlotte decided to go around the loop one more time by herself and did not return.

Her parents went to look for her, a search soon joined by other campers and a crush of law enforcement personnel. They found her bike and combed the woods but could not find her. On Monday, that search continued at the park — which was closed — with bloodhounds darting into the woods, trying to catch a scent.

Others had come to offer whatever help they could, including Patrick Kane, who said he had hoped to help the search, but wasn’t trained and was thus turned away. He said he had texted with Charlotte’s father, David, who he is friendly with, and said the family had remained optimistic that Charlotte would be returned safe.

“These are wonderful, wonderful people,” Mr. Kane said. “We never want this to happen to anybody. But you are just shocked when it happens to someone like this.”

Ms. Hochul said that she had received calls from all over the nation, worried about Charlotte, a fourth grader whose parents had described her as “a happy-go-lucky little girl.”

She added that she had worried as the hours passed, noting that the first 48 hours can be critical to such investigations, and that as time passes, “hope starts to wane.”

“When you hit that 48-hour moment, you realize it’s going to be tough and you start thinking the worst,” Ms. Hochul said. “But what happened was extraordinary.”