A dog was rescued in Texas on Wednesday after members of the U.S. Coast Guard discovered the pup trapped inside a shipping container, officials said.

Members of a Coast Guard inspection team were randomly selecting containers from among thousands at the Port of Houston when they suddenly heard barking and scratching from inside one of the containers stacked about 25 feet in the air, the U.S. Coast Guard Heartland said.

When they lowered the container and opened the door, out popped a "very happy dog," officials said. 

"This sweet girl was trapped in the container for at least a week and was tired, hungry, and very happy to see her rescuers," the Coast Guard said.

ILLINOIS POLICE K-9 FATALLY SHOT WHILE CHASING FLEEING SUSPECT

coast guard inspection team with Connie outside containers

Members of a U.S. Coast Guard inspection team found Connie trapped inside a shipping container of the Port of Houston. (U.S. Coast Guard Heartland )

The pup – since nicknamed Connie the container dog – had gotten stuck inside a container full of totaled cars originating from the Houston-Galveston area that was about to be shipped overseas, according to the Coast Guard. Officials said it was not immediately clear where the container was being shipped. 

Connie

Connie was trapped inside the container for at least a week, and was "very happy" to see her rescuers, officials said. (U.S. Coast Guard Heartland )

"So based on that, they think that the dog most likely was in a junkyard, in a car. And that’s how she accidentally got put in the container," Guard spokeswoman Chief Petty Officer Corinne Zilnicki told the Associated Press.

Connie with Coast Guard rescuers

Connie the container dog is pictured with members of the U.S. Coast Guard who heard her barking inside a container that was among thousands of others. (U.S. Coast Guard Heartland )

PENNSYLVANIA FAMILY REUINITES WITH LOST CAT AFTER MULTI-CAR CRASH IN MINNESOTA

After giving Connie some water, the Coast Guard team brought the lucky pup to an animal shelter. 

As of Sunday, Connie was in the care of Forever Changed Animal Rescue, where she was being treated for heartworm and awaiting adoption, according to the shelter.

CLICK TO GET THE FOX NEWS APP

"We will also be doing a full workup on her to ensure that she receives all the care she needs and deserves," the group said on its Facebook page.