Place garlic cloves in an ovenproof container and pour in the olive oil, making sure all cloves are covered. Cover with aluminum foil and roast in a preheated 300-degree oven until light brown, about 1 hour.
Strain the garlic and puree in a blender, adding a little of the strained oil if necessary to form a smooth paste.
Transfer to a container and pour in enough oil to cover. Use as needed, storing the remainder in an airtight container in a refrigerator. Refrigerate and store the garlic-infused oil in a separate container.