Margery Magill was on her regular rounds walking dogs for residents in Park View, her latest charge a tiny yellow pit-bull mix. She was headed back to an apartment building on Irving Street NW when she was killed Tuesday night by a man police believe was a stranger.

For no reason authorities can immediately discern, a man repeatedly stabbed the 27-year-old Magill about 8:45 p.m. and then ran, the District’s police chief said.

Her screams of “Oh, no!” and “Help me!” alarmed a couple winding down a quiet night at home. They rushed outside and found the dog, sitting by itself, howling, its leash loose. Then they saw Magill lying on her back, bloodied, her eyeglasses on the sidewalk.

Christopher Alan Chambers said he tried to revive her and then got help from a neighbor more skilled in CPR. Magill died a short time later at MedStar Washington Hospital Center, less than a third of a mile from where she was attacked in the 400 block of Irving Street NW.

Police said they arrested Eliyas Aregahegne, 24, later that night inside an apartment on Columbia Road NW and charged him Wednesday with first-degree murder while armed. Two law enforcement officials said investigators are working to determine whether the suspect has mental-health issues.

D.C. Police Chief Peter Newsham said that a motive remains unknown, that detectives have ruled out robbery and sexual assault, and that they found no connection between the victim and the suspect. Newsham drew comparisons to two other random killings that have claimed the lives of people doing the most everyday activities in neighborhoods not accustomed to violent crime.

A police spokesman confirmed that he was referring to Wendy Martinez, a runner who was brutally stabbed by a disturbed man in September as she passed through Logan Circle, and Robert Bolich, a 62-year-old bridge inspector stabbed on the job last week, allegedly by a man who told police that the devil made him do it. Martinez’s killer has been convicted; a man charged in Bolich’s stabbing is awaiting trial.

Newsham said he hopes the quick arrest in Magill’s killing will help “alleviate some of the fears that are out there in the community.” He called the District, experiencing a 13 percent spike in homicides this year, “a very, very safe city” and called this type of crime “very rare.”

Magill’s father, Jeffrey Magill, said his daughter was “minding her own business and somebody just decided to attack her.” Speaking from his home in Yuba City, Calif., north of Sacramento, he said, “I don’t know how you get a handle on somebody doing something like that.”

Margery Magill and her sister — daughters of now-retired schoolteachers — raised goats and helped 4-H clubs with agricultural programs. From the age of 9, she wanted to see the world, Jeffrey Magill said, and she made it to nearly two dozen countries, saying to family and on the Internet that she traveled so much she proudly did not own a bed.

“She had more of a life in her 27 years than a lot of people have in their whole lives,” Jeffrey Magill said, offering a partial list of the place she either visited or lived — Costa Rica, Tanzania, Nicaragua, Turkey, India and Zanzibar. She hitchhiked, took planes, hopped on motorcycles, farmed with locals and lived with indigenous people in Africa.

Jeffrey Magill described his daughter as a “handful” while growing up, noting she challenged her teachers as early as kindergarten. “She was stubborn, quite opinionated,” her father said, but also “a model kid” who studied hard and played the guitar. They disagreed on politics — he a supporter of President Trump, she a liberal who attended Barack Obama’s first inauguration and joined the Women’s March.

Margery Magill graduated from the University of California at Davis and participated in a program that landed her a job with the Jane Goodall Institute. Her jobs after college varied from grain merchandiser to helping a company that produces trivia games.

She maintained her interest in higher education, and she recently worked with a group connecting college students to jobs in agriculture. Co-worker Brytann Busick called her a “natural leader” and “the most outwardly friendly of the group.” Busick added: “She followed her passions; she was into a lot of things. She always had a smile on her face, always.”

Magill graduated this year from the University of Westminster in London with a master’s degree in international relations. She moved to the District, working as project coordinator at the Washington Center helping place graduate students in jobs and internships around the world.

She lived near Howard University and picked up extra money walking dogs as a contractor for a dog-walking company called Rover, a sort of Uber for dog owners. She was walking a dog for a tenant in an apartment building on Irving Street when she was killed.

Her screams caught the attention of Chambers, a 57-year-old lecturer at Georgetown University and his wife, Dianne. Chambers didn’t know Magill but recognized her from previous dog-walking stints because of her short red hair cut into a bob style and high-top sneakers.

“She was always very friendly,” he said.

Jeffrey Magill said his daughter was also “pretty tough and in good shape,” and as he tried to comprehend his loss and the apparent random attack, he said: “Whatever happened, she probably fought it pretty good.”

Then he paused, adding, “I’m hoping she did.”

Rachel Weiner and Fenit Nirappil contributed to this report.