Yes, atrial fibrillation is sometimes treated with a pacemaker.
For some people whose A-fib can't be managed with medication, cardiologists may suggest a procedure, called "AV node ablation," that permanently blocks the electrical connection between the upper and lower parts of the heart. Since this procedure eliminates the body's usual method of telling the heart to beat, the person then must get a pacemaker.
Although this approach to atrial fibrillation tends to eliminate symptoms due to atrial fibrillation, it does not eliminate the risk of stroke, since the heart's upper chambers continue to fibrillate. For this reason, most A-fib patients with pacemakers still receive treatment with blood thinners.