GUATEMALA CITY — For days they have traveled north from their homes in Honduras, walking, taking buses and hitching rides in cars and trucks. They have carried only the essentials in small bags and knapsacks.

As the large caravan of migrants entered Guatemala on its way toward the United States, more people had joined the march, which has fractured into smaller units. By Wednesday night, some had stopped to rest and sleep in Guatemala City. There were many families and pregnant women among the ranks.

The caravan — as many as 4,000 people by some estimates — has prompted a flurry of tweets from President Trump, who on Thursday threatened military action at the southwestern border of the United States if Mexico failed to halt the group.

The caravan’s participants are making the journey for several reasons. Some say they are fleeing gangs that terrorize their neighborhoods and are seeking sanctuary in Mexico or the United States. Others are in search of work and more stability for their families.