SAVAR, Bangladesh — In an unexpected turn in the investigation into the deadly collapse of the Rana Plaza building, the Bangladeshi police on Thursday arrested the engineer who warned a day before the disaster that the building was unsafe.

The collapse of Rana Plaza, which housed five garment factories employing more than 3,000 workers, is now considered the deadliest accident in the history of the garment industry, with the death toll so far at 446 and many others still missing.

The arrest of the engineer, Abdur Razzaque Khan, was a surprise twist since he was regarded as something of a hero for trying to avert the April 24 disaster. A day before the building collapsed, Mr. Khan had been summoned because cracks had suddenly appeared in the structure, forcing an evacuation. He concluded that the building had become dangerous and should be closed until experts could conduct a more thorough investigation — advice that turned out to be grimly prescient.

His comments appeared the next morning in at least one national newspaper. But the police say that the building’s owner, Sohel Rana, and the factory owners are blaming Mr. Khan, saying he told them the cracks were just a small problem. A police official said that Mr. Khan is being interrogated to determine who is telling the truth.