A Montana man has been arrested on suspicion of threatening to shoot a student for divulging a plot line from the newly released Star Wars epic, court documents show.

Police say Arthur Roy, of Helena, got “angry” with a student he had befriended on Facebook after the boy gave up a subplot to Star Wars: The Force Awakens during an online conversation last week.

During the online fight that ensued, Roy is alleged to have posted a photo of himself in which he appears to brandish a gun, which he indicates is a Colt 1911 with a “hair trigger”, according to a probable cause affidavit.

The affidavit also says the boy was fearful Roy was going to come to “shoot him”.

Roy also said he was “coming to find” the boy, whose school was placed on security “lockdown” after officials saw the exchange, according to the affidavit.

“The victim was afraid it was a legitimate threat,” said Melissa Broch, a deputy attorney for Lewis and Clark county. “The victim believed that the defendant might come to his school and harm him.”

Star Wars: The Force Awakens opened with a record-breaking $248m at the US and Canadian box office, and $529m globally over its opening weekend, Walt Disney Co said on Monday.

The film marks the seventh installment in a newly rebooted Star Wars franchise.

Roy was arrested on Friday on suspicion of assault with a weapon, a felony. He made an initial appearance in Lewis and Clark county justice court on Monday, after which he was ordered held on $10,000 (£6,750) bail, Broch said.

It was unclear whether Roy was still in custody, Broch said. He is likely to be arraigned in a state district court at some point in January, she said.