The authorities said that security footage showed two of the suspects on a motorcycle near the popular bar where Ortiz, 43, was shot on Sunday and that the two men had stopped to talk with other suspects in two other cars. García, they said, drove the motorcycle that carried the gunman to the scene of the shooting. García fell off the motorcycle as he tried to flee, and an angry group of people beat him severely before he was detained by the police.

García was charged as an accomplice to attempted murder. His lawyer told reporters that his client was a motorcycle-taxi driver who was unaware his passenger planned to commit a crime.

Ortiz was attacked at Dial Bar and Lounge, a regular hangout of his in the eastern part of Santo Domingo. Security footage of the shooting showed a man creeping up behind him and firing from close range. The bullet entered Ortiz’s back and exited his abdomen, seriously wounding him and causing him to slump over in his chair.

Ortiz’s gallbladder and part of his intestines were removed during an operation in Santo Domingo that lasted into Monday morning. His liver was also damaged.

Ortiz, who became one of baseball’s most beloved players by helping the Red Sox end their 86-year World Series drought with a victory in 2004, was taken by an air ambulance provided by the club to Massachusetts General Hospital in Boston on Monday afternoon. He had a second operation on Monday night and rested in the hospital’s intensive care unit. On Tuesday and Wednesday, he sat up and took some steps, according to statements from his wife that were released by the Red Sox.

“His condition is guarded and he will remain in the I.C.U. for the coming days, but he is making good progress towards recovery,” his wife, Tiffany Ortiz, said in a statement on Wednesday.