When Rashema Melson first walked across Georgetown University’s campus as a freshman in the fall of 2014, she told herself she was smart enough to be there, had worked hard enough to be there, deserved to be there. But she didn’t always believe her own pep talks.

Georgetown is an idyllic campus populated by many students who come to the Northwest Washington school from some of the nation’s wealthiest Zip codes. Melson had arrived from just across town, where she lived in a single room with her mother and two brothers at the homeless shelter located in the former D.C. General Hospital and next to the D.C. jail.

That room, lined with cots and packed with all their belongings, had been Melson’s residence while she attended Anacostia High School, where she earned straight A’s and graduated as valedictorian that spring. Her living conditions — the showers often had no hot water, she wore noise-canceling headphones so she could study — were a universe away from most of her new fellow scholars.

And so as she began classes that fall, she felt intimidated.

“ ‘This is Georgetown University. Is this really where I be­long?’ ” Melson remembered thinking.

On Saturday morning, the 23-year-old answered that question with a triumphant yes as she strode across the stage at Georgetown’s graduation ceremony. With a wide smile on her face and tears in her eyes, Melson accepted her diploma, a degree in justice and peace studies, and became the first person in her family to graduate from college.

“I literally got the chills as soon as they called my name,” Melson said as she stood in a sea of caps and gowns on the Healy Lawn on the Georgetown campus after the ceremony. Soon, she was swept up by well-wishers, including college friends, her high school track coaches, a cousin who drove up from Hampton, Va., and other close relatives — her younger brother, Edward Hendrix, a student athlete at Syracuse University, and her mother, Vanessa Brown.

“My heart was pounding when she walked up there,” said Brown, who no longer lives in a shelter. “I thought, ‘That’s my baby. Her dream came true.’ ”

Melson’s graduation is all the more remarkable when you consider the odds against her. According to census data, only 9 percent of the United States’ poorest young people — those whose family income puts them in the bottom quartile — earn a four-year college degree by age 24. By comparison, 77 percent of young people in the top quartile earn four-year degrees by 24.

Even graduating from high school was far from a given. When Melson finished at Anacostia High, the graduation rate at the school was just 58 percent, according D.C. Public Schools. The national graduation rate is 85 percent, according to the Education Department’s National Center for Education Statistics.

The path from her first day at Georgetown five years ago to diploma on Saturday was not the straight line she wished for as a freshman. It started with hope and promise. People whom she had never met learned of her story and sent advice, encouragement and even helped with bills. Georgetown had a program in place to assist students from low-income families adjust to their new surroundings. She was surprised and moved by how many people told her she inspired them.

But the universe throws curves, and Melson, who had already faced so many obstacles in her young life, was presented with challenges she hadn’t expected.

A self-described introvert, she kept to herself most of her freshman year. She wasn’t sure what her classmates thought about her. And although she had a full scholarship and additional assistance through the Georgetown Scholars Program, which was created 15 years ago to bring more ethnic and socioeconomic diversity to the school, her previous life hadn’t magically disappeared. Melson’s mother and younger brother still lived in the shelter. Her older brother was charged with assault and facing jail time.

One of the few steadying forces in her life was her high school boyfriend, and they began spending more time together. During Melson’s sophomore year at Georgetown, her boyfriend signed up to join the military and soon after, proposed to Melson. Given the tumultuous life Melson had known, the promise of love and the possibility of a happy family life were impossible to turn down.

Melson’s father was murdered when she was a baby. Her upbringing was chaotic. She moved so often as a child, she ended up attending 10 grade schools. When her boyfriend proposed, she envisioned a future with the security and the family structure she had always wanted. She left Georgetown, married her boyfriend and moved to live with him on a military base in Tennessee.

The marriage lasted a year. Melson said she tried to make it work, but she thought she was sacrificing too much. She realized it was fear of failing that led her to abandon dreams of college and career.

“I said to myself, ‘You worked so hard all your life even before you met this boy. You came up through the trenches, you came from a really tough background and you worked so hard. Why would you give that all up?’ ” Melson said. “I was being a coward and running away from the challenge.”

She reapplied to Georgetown and returned determined to earn her degree. From every corner, she says, she had support. Her brothers and mother rooted for her. Her friends had her back. Teachers and administrators encouraged her.

Marc Howard, a professor who taught Melson in two of his classes, says he admired how she navigated her life at Georgetown while staying connected to her pre-college life and friends.

“Rashema is extraordinary in that she has crossed a divide that is really hard to do,” Howard said. “She didn’t just transition to becoming a Georgetown student and never look back. She stayed true to herself. She’s always embraced where she’s from and the people she grew up with and she feels a responsibility to help them.”

Kaela Jackson, a close friend who bonded with Melson over their love of food and cooking, said she, too, admires Melson’s tenacity in pursuing her goals.

“I’m just in­cred­ibly proud to be associated with her,” said Jackson, who graduated from Georgetown last year. “To have friends who come from difficult backgrounds and do amazing things, it’s really inspiring.”

Another friend, Wesley Bowers, a rising junior at Georgetown, said Melson’s graduation “is a huge accomplishment.”

“Given her circumstances, to make it out and survive, that really stuck out to me,” Bowers said. “She really had a difficult situation. I’m proud of her. She’s going to leave a mark on a lot of people.”

Melson credits her success to her faith in God and the backing of friends, teachers and “supporters who came out of nowhere” to help her. She also credits her own resilience.

“I feel strong because there are moments in life that I felt like I could break and never get back up. I felt like that in the marriage. I felt like that coming to Georgetown. I felt like that through different life circumstances,” Melson said. “But I keep [getting back up] again and again.”

With her Georgetown degree in hand, she says she wants to work in public policy to help assist impoverished and underserved communities. She’s considering job offers from community service organizations and will choose one soon. In a couple of years, she would like to pursue a law degree. Most of all, she wants to be seen as an example of what can be achieved even in the most difficult circumstances.

“I want people to look at me and say, ‘She did it, I can do it,’ ” Melson said.

Emma Brown and DeNeen L. Brown contributed to this report.