A former U.S. Marine accused of breaking into North Korea's embassy in Madrid and assaulting diplomatic personnel was freed on $1.3 million bond in Los Angeles on Tuesday.

As a condition of his release, Christopher Ahn must confine himself to his home in the Los Angeles suburb of Chino Hills ahead of his possible extradition to Spain and must wear an ankle monitor.

CALLS GROW TO DROP CASE AGAINST US MARINE AND ACTIVIST AND ACTIVISTS IN NORTH KOREA EMBASSY INTRUSION

“I spent a lot of time reading about you and I’m confident you’re going to do the right thing,” U.S. Magistrate Judge Jean Rosenbluth told Ahn, who had several family members in attendance at the hearing.

Ahn can only leave his home for medical appointments and church. He is expected to be released in the coming days.

Spanish authorities have charged Ahn, 38, who spent six years in the Marines and served in Iraq, with breaking into the North Korean embassy with five others on February 22. They said the group beat some embassy staff and held them hostage for hours before fleeing.

The charges include breaking and entering, robbery with violence and causing injuries, according to U.S. court documents.

NORTH KOREAN REFUGEE: WE TOOK HUGE RISKS TO HELP OTHERS REACH FREEDOM. WHY ARE US, SPAIN PUNISHING US?

Ahn is said to be a member of Free Joseon, or the Cheollima Civil Defense, an activist group which supports North Korean defectors and seeks to overthrown North Korean leader Kim Jong Un. Two people allegedly involved in the embassy incident are still at large, including Adrian Hong, a Mexican national and longtime U.S. resident who is the purported leader of the group.

Christopher Ahn (U.S. Marine Corps)

Christopher Ahn (U.S. Marine Corps)

Attorneys for Free Joseon said the allegations of violence are lies from Kim's diplomats, who they say made up the story to save their own skins. They claim the group members were invited inside and that there were no problems.

"The extradition papers from Spain confirm that almost the entire case against Mr. Ahn is based on uncorroborated statements made by high-ranking North Korean officials," Ahn's attorney Naeun Rim told Fox News in a statement last week.

NORTH KOREANS WANT TO KILL EX-MARINE ACCUSED OF ENTERING PYONGYANG'S SPAIN EMBASSY, JUDGE SAYS

Video obtained by Fox News shows the activists walking into the embassy and chatting with a member of Kim's diplomatic corps. One activist takes official photographs of Kim and his father Kim Jong II from a wall and smashes them on the floor.

Ahn was arrested by U.S. agents in April in Los Angeles. His actions have made him a target of the Kim regime, Rosenbluth said in an order conditionally granting him bail.

Ahn during his tour of duty as a Marine in Fallujah, Iraq (Provisional Government of Free Joseon)

Ahn during his tour of duty as a Marine in Fallujah, Iraq (Provisional Government of Free Joseon)

"The F.B.I. has confirmed that the North Korean government has threatened his life," the judge wrote. "He is apparently the target of a dictatorship's efforts to murder him."

CLICK HERE TO GET THE FOX NEWS APP

Prosecutors objected to Ahn's release, citing him as a flight risk.

“It’s like a huge weight has been lifted off of our shoulders knowing that he’s going to be home, he’s going to be with loved ones, we can visit with him now,” Juan Sanabria, a former Marine who served with Ahn, told Reuters.

Fox News anchor and senior correspondent Eric Shawn contributed to this report.