BOUND BROOK — The 28-year-old borough resident would post more than 50 times a day on Facebook.

To any of the dozens of “friends” who may have bothered to follow Hector-Juan Padilla on the platform, many of these posts must have appeared to be nothing more than nonsense with little or no connection to reality.

One post, for instance, said he'd seen a "mini midget goblin that poked his head out of the door and disappeared." Another recounted how a squirrel had tried to mess with him. A few videos and messages seem to indicate that he believed his stove was somehow changing the color of the sky.

But to arson investigators looking into the cause of a massive fire that destroyed an unfinished apartment building the size of a block, leaving the borough’s downtown looking like a war zone in the aftermath, some of the ravings took on menacing new meanings.

“I’m thinking of burning down this building that they put up to f--- with my head,” investigators say Padilla wrote at 4:53 p.m. on New Year’s Day in a post that is no longer visible.

“Going to start the fire at 7,” he posted three days later without further context.

On Jan. 12 at 3:54 p.m., his Facebook says: “I will burn the world to the ground.” Four hours later, police and local fire companies were responding to a fire at the Meridia II building under construction at 14-16 E. Main St.

Before the fire was brought under control, it had wiped out the construction site and spread to several homes and an electronic store at 18 W. Main St., 1 E. Main St., and 13-15 W. Main St.

A day later, Padilla was arrested and charged with aggravated arson (based on the fact that a firefighter sprained an ankle) and hindering apprehension.

The clues that led investigators to Padilla, who lives on East 2nd Street — less than a dozen short blocks from the fire — included surveillance video from neighboring businesses as well as the rambling Facebook posts.

Police say Padilla also incriminated himself by lying to investigators, saying that he was nowhere near the construction site even though video placed him there.

Prosecutors say the fire caused at least $52 million in damage in a borough that's been hoping to catch a break from its history of devastating flooding. More than 100 residents were forced out of their homes and 15 people were permanently displaced because the fire damaged their boarding home.

A Superior Court judge sitting in Somerville on Friday ordered Padilla to be held without bail pending a trial. His attorney, Matthew Katzenbach, had argued that Padilla should be freed because he posed a low risk of flight, had ties to the community and had two young children living in the state.

Investigators said in an affidavit of probable cause that they pulled surveillance video from the United Fitness Gym, located on the opposite side of a parking lot on the Meridia II building’s east side, and from Frascella’s Liquor Store at East Main and John Streets, across the street from the lot.

Police say the videos show a heavy-set man wearing a black T-shirt under a gray-and-white checkered shirt with the word “Savage” on it. The man also is wearing blue jeans, a black-and-gray skully cap and black-and-white sneakers.

The video shows the man going into the liquor store, where he purchased some booze and Black & Mild cigars, police said.

The video shows the man leaving the store and walking across Main Street in the direction of the Meridia II building.

Video from the gym building shows the man walking into the lot next to the Meridia II.

“The subject is seen walking into the area of the origin of the fire several times,” investigators say in the affidavit filed with the court. “On the second time the subject is seen leaving the area of the origin, smoke is seen emanating from the area of origin behind the subject.”

The document says that police obtained a search warrant for Padilla’s clothes, which were collected as evidence.

Site of the fire on East Main Street and Padilla's home on East 2nd Street

The Associated Press contributed to this report.