Some of Europe's largest retailers agreed Monday to sign a legally binding agreement designed to improve safety conditions in Bangladesh's garment factories after a building collapse last month killed at least 1,127 workers and injured many more.

Under the five-year accord, Hennes & Mauritz AB, Inditex, the Spanish parent company of Zara, Tesco PLC and others agreed not to hire manufacturers whose clothing factories fail to meet safety standards and committed to paying for necessary repairs and renovations. The pact was...