Nearly half of Washingtonians in the city’s poorest neighborhoods say they or someone they know has been threatened with a gun or shot in the past five years, a Washington Post poll finds.

Across the city, about a third of District residents say they or someone they know has been menaced or been the victim of gun violence since 2014, even as a large majority of Washingtonians say they feel safe in their neighborhoods.

But firsthand experience and awareness of people who have had encounters with guns is far more prevalent — 46 percent — east of the Anacostia river, in Wards 7 and 8, the city’s most impoverished and highest-crime neighborhoods, the poll finds.

Keturah Priester, 23, who grew up in Anacostia, said a gunman in a passing car shot in the direction of her younger brother as he was walking home four years ago, an incident that shook her because “anything could have happened.”

Priester herself had to duck and run one night several years ago after “someone rolled by in their car and did a drive-by” outside her apartment near Benning Road NE. “You get down low, and once the shooting stops, you run,” Priester said. She was not injured.

By then, her half brother had been killed and two other half brothers were struck by gunfire in an incident nearly a decade ago in Prince George’s County. Despite the toll of violence, she and her family are not giving up on their hometown.

“We love D.C.,” Priester said. “This is all we know.”

Homicides in the District are up 6 percent this year over 2018 and have increased by 45 percent since 2014, according to D.C. police. But the murder rate is still far below what it was in the late 1980s and early 1990s. In 1990 alone, 474 people were slain in the District. The city has recorded 152 homicides this year, as of Monday. Armed robberies have declined by 9 percent since last year, but assaults involving guns have risen by 13 percent.

African Americans are almost twice as likely as whites to know someone who has experienced gun violence, according to the Post poll. People between the ages of 18 and 39 are also more likely than those 40 and older to know people who have encountered guns, the poll finds.

Even in areas with lower crime rates, Wards 1 and 4, which include neighborhoods such as Adams Morgan, Brightwood and Shepherd Park, 38 percent say they know someone who has had a personal encounter with guns. In Wards 5 and 6, which include Capitol Hill and gentrifying neighborhoods such as NoMa and Navy Yard, the percentage of those with a similar experience is 28 percent.

Nearly 8 in 10 say they feel safe from crime in their neighborhoods, but just a quarter say they feel “very safe.” White Washingtonians are 20 percentage points more likely to say they feel at least somewhat safe (89 percent) than black Washingtonians (69 percent).

Just over 6 in 10 residents who live in Wards 7 and 8, which include neighborhoods such as Congress Heights and Deanwood, say they feel protected from crime where they live. By contrast, more than 9 in 10 residents say they feel safe in Wards 2 and 3, which include areas such as Glover Park, Tenleytown and Chevy Chase.

Paul Krupa, 62, a maintenance manager for ships who lives in the Capitol Hill area, said the owner of a neighborhood market where he regularly shops was pistol-whipped during a robbery a couple of years ago.

“It was shocking because it’s right around the corner,” Krupa said. “The brazenness was just incredible.”

Krupa has lived in the District since the early 1990s, long enough to have witnessed the new development that has reshaped many neighborhoods, including his own. Along Eighth Street SE, the corridor known as Barracks Row, he said he could find a handful of dive bars and places to eat when he arrived.

“Now you can go to a different restaurant every day of the month,” he said.

More than 4 in 10 Washingtonians, 43 percent, say that in recent years their neighborhood has improved, while an almost equal share, 41 percent, say theirs remain “about the same.” The poll finds that 12 percent say their neighborhoods have gotten worse.

“My bottom line has improved,” Krupa said. “But it’s not necessarily fair to the citizens of D.C. who are getting displaced. Anacostia is still treated kind of like a stepchild. They’re struggling to get retail and supermarkets.”

A study earlier this year found that the District has undergone the greatest “intensity of gentrification” of any city in the country, with the most African American residents — more than 20,000 — displaced from their neighborhoods mostly by affluent white newcomers between 2000 and 2013.

The poll finds agreement across class lines — 73 percent of those earning more than $200,000 a year and 72 percent of those making less than $50,000 — that high-income residents reap the rewards from new apartments, stores and restaurants.

More than half, 54 percent, say that gentrification benefits whites more, while 2 percent say it helps blacks more. An additional 39 percent say it is a boost for whites and blacks equally.

Half say that gentrificationis more of a boon for newer D.C. residents, slightly more than thosewho say new development benefits newcomers and longtime residents about equally.

By about a 2-to-1 margin, Washingtonians say that redeveloping parts of the city to attract busi­nesses and residents is “mainly good,” as opposed to “mainly bad” for people like them. White Washingtonians and those in households earning more than $200,000 a year are more likely than blacks and those making less than $50,000 to say that new development is “mainly good.”

Overall, about three-quarters of Washingtonians say they have “excellent” or “good” access to fresh fruits and vegetables, including nearly 9 in 10 in Wards 2 and 3, which encompass prosperous neighborhoods such as Georgetown, Cleveland Park and Friendship Heights. The percentage is slightly lower — 8 out of 10 — in Wards 1, 4, 5 and 6, which include Adams Morgan, Brightwood, Brookland, NoMa and Capitol Hill.

But in Wards 7 and 8, where there are three major supermarkets serving 160,000 people, just under half of the residents say access to fresh groceries is at least “good.”

One aspect of D.C. living, parks and recreation facilities, gets uniformly high grades. Three-quarters of Washingtonians say their neighborhood parks and recreation facilities are “excellent” or “good.”

Two-thirds say the same about access to health-care services — peaking at over 8 in 10 in Wards 2 and 3 but dipping to fewer than 6 in 10 in Wards 7 and 8.

Michelle Minor, 55, a caregiver for seniors who lives in Congress Heights, said she enjoys a recently opened Thai restaurant in Navy Yard and the Trader Joe’s near Eastern Market. But she said that most of the new housing seems as though it’s intended “to build a tax base.”

“In the past it was to build communities,” she said. “Now it’s, ‘Let’s put this building by a Metro and charge an exorbitant amount of money and it’s for young adults on the career track.’ They go to the restaurants or they go to the gym and then they go back upstairs.”

Mary Holmes, 38, an attorney who is married and has a child, is among those professionals who live in one of those new buildings, paying $3,200 month in NoMa for a one-bedroom apartment with an office. But Holmes said she often feels out of place.

“We get a lot of odd looks from people for having a kid,” she said. “It feels like these kinds of places are for people with more discretionary income. You get this twinge that you’re not making great financial decisions.”

Just over 8 in 10 Washingtonians rate their neighbors as friendly, a number that peaks at 90 percent in Wards 2 and 3. By comparison, 71 percent in Wards 7 and 8 rate their neighbors as friendly. Less than half of residents citywide, 45 percent, give the public schools in their neighborhoods a positive rating.

If they had to move today, poll respondents are split: About half say they would have to relocate to the suburbs to find something they would like and could afford and about half say they could find something in the District.

Nastasia Peteuil, 31, a Voice of America editor who lives in Columbia Heights, said she has enjoyed the new restaurants and bars and the area’s vibrancy since moving in four years ago.

But Peteuil, a native of France, said her enthusiasm has been tempered by her developing awareness of potential dangers. A couple of years ago, a woman she knows from the neighborhood told her that she was mugged at gunpoint as she walked along Irving Street NW between Sherman and Georgia avenues.

“It was shocking to me because it was a street I take a lot,” said Peteuil, who grew up in Burgundy, which she described as crime-free. Then, a couple of months ago, six people were shot outside an apartment complex around the corner from where she and her husband live. She no longer walks alone at night.

“We felt safe, and now we’re careful,” she said. “It’s crazy.”

The Post poll was conducted Nov. 12-17 among a random sample of 905 adult residents of the District reached on cellphones and landlines, and it has a margin of error of plus or minus four points.

Scott Clement contributed to this report.