The Thurgood Marshall Federal Judiciary Building in Washington, D.C., had a bird problem.

The animals were trying to fly into the building’s atrium, hitting the glass around it, and dying. People found about five dead birds a week in front of the building, according to city officials.

Turned out there was a simple solution: keeping the lights off at night.

This kind of friction between humans and animals in cities is common. Elsewhere in D.C., a bus hit a snowy owl (it survived, only to be killed by a car months later in Minnesota). In New York City, a coyote climbed onto a bar roof, distressing some residents. And in March, P-22, a mountain lion living near Los Angeles may have killed a zoo koala.

There are many explanations for how and why animals end up in cities, but more and more we are inviting them. The issue is, urbanites aren’t the best hosts.

Now, to protect urban wildlife, it’s our turn to adapt.

How Green Was My Alley

Ironically, many of these encounters between humans and animals are caused by our love and appreciation for nature.

As people move to cities—part of a global urbanization trend—local governments are looking for ways to attract youths who would’ve gone to the suburbs 50 years ago.

“When you move to a neighborhood, you want your latte, you want to be close to [public transit], and you want a park,” says Stella Tarnay, an urban planner and co-founder of Biophilic DC, a group that works to make cities better habitats for animals and people.

Wild Cities About two-thirds of all people will live in urban areas by 2030—and we won't be alone. A veritable menagerie of wild animals is also taking a liking to city living. This National Geographic series will feature some intriguing tales about urban wildlife and the ways cities are coping with the influx.

And it goes beyond maintaining existing parks. To please residents and to combat climate change, cities and civic organizations are planting more trees and turning unused spaces into parks and meadows. (Read how urban parks are bringing nature closer to home.)

Meanwhile, builders are installing native landscaping and green roofs to keep cool in every sense of the word. All this, combined with efforts to bring cities into compliance with clean water and air laws, has made urban areas much more habitable for animals.

“We’re seeing things we haven’t seen in a long time,” says Tommy Wells, director of D.C.’s Department of Energy and Environment.

That includes nesting bald eagles, long-eared brown bats, and monarch butterflies, which are attracted to the milkweed planted outside of Wells’s office.

Many of these animals still have fragile populations: The District hosts 205 species that need protection—that's 90 species more than a decade ago.

Threatened Wildlife in Washington, D.C. The Species of Greatest Conservation Need (SGCN) lists species identified as imperiled or in decline. More species are in trouble today compared with 2005. SGCN 2015 SGCN 2005 Birds 35 58 Dragonflies & damselflies 9 27 Crustaceans 19 22 Mammals 11 21 Amphibians 16 18 Reptiles 23 17 Mollusks 9 13 Fish 12 12 Butterflies 13 10 Bees 0 4 Sponges 0 2 Beetles 0 1 NG STAFF SOURCE: WASHINGTON, D.C., DEPARTMENT OF ENERGY & ENVIRONMENT Threatened Wildlife in Washington, D.C. The Species of Greatest Conservation Need (SGCN) lists species identified as imperiled or in decline. More species are in trouble today compared with 2005. SGCN 2015 SGCN 2005 Birds 35 58 Dragonflies & damselflies 9 27 Crustaceans 19 22 Mammals 11 21 Amphibians 16 18 Reptiles 23 17 Mollusks 9 13 Fish 12 12 Butterflies 13 10 Bees 0 4 Sponges 0 2 Beetles 0 1 NG STAFF SOURCE: WASHINGTON, D.C., DEPARTMENT OF ENERGY & ENVIRONMENT

All this wildlife is a benefit for residents. Exposure to nature is great for our busy, technology-addled brains, research shows. “People, in general, like the idea that they have wildlife in their city,” Wells says.

But animals don’t follow zoning or park boundaries, and trouble comes when they leave green spaces: Birds swoop into traffic, white-tailed deer (overpopulated in many areas) dash between urban parks, and animals like raccoons and coyotes follow green trails into cities and end up on top of bars.

Luckily, there are ways to prevent these incidents without getting rid of the animals entirely, such as creating safer ways for them to navigate the big city.

Happy Coyotes

When animals end up in traffic or near homes, they’re simply following corridors between one habitat and the next.

“Everything is a corridor for wildlife,” Tarnay says. “If a neighborhood stands between two microhabitats, it becomes a corridor. If a street does, it becomes a corridor.”

Tarnay has seen this in person—she once spotted a coyote in a neighborhood just about two miles (3.2 kilometers) from the White House.

It was a dangerous situation for the coyote and possibly nearby pets, but Tarnay says it doesn’t need to be so risky for animals, domesticated or wild. "How can we have happy coyotes?” she asks.

One way is to design wildlife corridors through cities to limit danger for animals and people, and it's something architects are increasingly thinking about when they plan new green spaces.

"A lot of work we're doing is creating those green corridors,” says Susannah Drake, the principal of the New York-based architecture firm DLANDstudio. “We understand quite fully the ramifications of what we're doing."

Green corridors can be small, like tunnels underneath busy roads instead of cement barriers, which can trap animals. They can also be larger and implemented across cities.

A 2006 study out of Switzerland suggests that green roofs with deeper soil beds will grow a variety of plants closer to what would thrive on the ground. (See "Earth Day Pictures: Extreme Green Buildings.")

“That will attract invertebrates, which will, in turn, attract birds,” says Anne Lewis, the head of City Wildlife, a D.C.-based organization that protects urban animals.

And this, she says, creates “stepping-stones from one habitat to another across the city.” This corridor also keeps birds at roof level and away from cars and windows.

'Cross-Species Diplomacy'

Ultimately, though, happy coyotes (and birds and bugs and raccoons) come from smarter humans, not just smarter architecture.

"If there is an introduction of wild systems into the city, there needs to be an education that nature is harsh and one needs to be careful with it,” Drake says. (See five unconventional ways to get people hooked on nature.)

“In the same way kids in the city are taught to look both ways before crossing the street, there are dangerous situations you learn about and become aware of."

People in cities don't just risk getting hit by a bus, they risk harming delicate ecosystems, hitting deer or birds with their cars, or inviting raccoons into places they shouldn't be.

Groups like Tarnay’s Biophilic DC are working on this. And so are some governments. Like many states, D.C. has a Wildlife Action Plan.

Wells calls it “a way to introduce wildlife to people.” The plan documents species and habitats and encourages their preservation, and it also discourages bad behavior on citizens’ part, such as letting dogs run off leash in parks where they may disturb habitats and wildlife.

“As a species, we have to learn how to make space for each other,” Tarnay says. “We need cross-species diplomacy."

In the end, that will determine whether people or animals are the true invasive species.