SEATTLE — A year ago, when Amazon let a homeless shelter for families move into a former motel it owned, it was viewed as a nice but fleeting gesture.

The motel was on a chunk of downtown property where Amazon planned to eventually erect yet another set of sparkling buildings to meet its insatiable need for office space in this city, where it has come to embody both the region’s economic boom and its struggles with affordability. The hotel would be torn down and the shelter kicked out when that time came.

Instead, Amazon has decided to let the shelter stay. In an unusual arrangement, the company has agreed to give the shelter, Mary’s Place, a permanent home inside one of the new office buildings for which it will break ground in the fall.

Amazon will give roughly half of the six-story building to the shelter, providing it with 47,000 square feet of space with private rooms that can hold 65 families, or about 220 people and their pets. The facility, expected to open in early 2020, will have its own entrance and elevators.