Mehmet Yalcin, left, and Chris Juncal in Rock Creek Park in Washington. (Lance Rosenfield/Prime)

Nearly 22 percent of land in the District is considered a park. Ninety-seven percent of D.C. residents live within a half-mile of parkland. And there are plenty of basketball hoops for residents to use in the city.

All of those recreation bona fides earned the nation’s capital the No. 3 spot on a list of the best U.S. cities for parks, according to an annual ranking released Thursday by the Trust for the Public Land, which advocates for parks in neighborhoods across the nation.

Arlington County came in fourth place. Minneapolis and St. Paul, Minn., finished first and second place, respectively, while San Francisco rounded out the top five.

The nonprofit organization’s ParkScore index typically examines parks in the nation’s 75 largest cities, but this year it expanded to the nation’s 100 largest cities and included Arlington. The District also placed third in 2015 and finished sixth the previous year.

The index takes into account parks’ size, accessibility and amenities, such as playgrounds and basketball hoops. It also considers the amount of money spent per resident on parks. This gives the District and Arlington a bit of an edge, considering how much National Park Service money flows into them.

The report said the District annually spends $287 per resident on parks; Arlington, $235.

At 0.8 acres, the District’s median park size was smaller than other jurisdictions in the Top 10 because of smaller parks, such as Logan and Dupont circles.

Despite their high rankings, the District and Arlington have room to improve, the report said. D.C. scored low marks for its number of playgrounds, with 1.7 playgrounds per 10,000 residents, or 111 total.

“Now that more young families are staying in the city and not moving to the suburbs, there’s even more of a need for playgrounds,” said Peter Harnick, director of the Trust for Public Land’s Center for City Park Excellence.

Arlington has 4.6 playgrounds per 10,000 residents. Harnick said Arlington is maximizing its park space, but it is lacking in park acreage. About 11 percent of Arlington is parkland. Still, Arlington manages to have 3.6 dog parks per 100,000 residents and four basketball hoops per 10,000 residents.

“We are always looking to expand and build out on our existing parks,” said Jane Rudolph, director of Arlington’s Parks and Recreation Department. “But the survey does not take into account our school system. We have a really good relationship with our school system, and we utilize their spaces and fields.”

Keith A. Anderson, director of the D.C. Parks and Recreation Department, said he was pleased with the city’s high ranking.

Arlington and the District received high marks on the prevalence of recreation and senior centers. The rankings did not account for fitness facilities, but the city announced last year that it would eliminate fees at the city-run fitness centers in 2016. The city has 2.4 recreation centers for every 20,000 residents.

Read more:

You need to earn $31.21 an hour to rent a two-bedroom apartment in D.C.