The Portland landlord who made an agreement with the city to fix code and fire safety violations at his apartment building on Dartmouth Street has made all the improvements required by a court order, city officials say.

On Tuesday, the building owned by Gregory Nisbet passed the second of two inspections conducted after a judge approved the agreement, said city spokeswoman Jessica Grondin.

Nisbet had until the end of business Monday to repair or replace a detached electrical socket in the basement of the building and certify that the electrical systems were in safe, working condition.

A week earlier, Nisbet met a deadline to remove locks that had been placed on individual rooms, clean up trash and other debris, ensure that smoke detectors were working, install a sprinkler head and provide a list of current tenants to the city.

Locks on individual bedroom doors can be an indication that an apartment building is being operated as a rooming house, which requires a special city license and additional fire protections.

Nisbet has been under scrutiny since a fire in November at his building on Noyes Street killed six young adults. Soon thereafter, tenants of one of the two apartments in the Dartmouth Street building filed complaints with the city about the living conditions there.

The city got a court restraining order last month to keep tenants out of that apartment, which was deemed uninhabitable.

Tenants continue to live in the adjacent apartment. The court-approved agreement requires all tenants to be screened and to sign written leases that are provided to the city.