In the Chamber of Mazarbul, the Fellowship has already discovered exactly what a defended doorway can become.
Orcs have attacked through the western door. A great cave-troll has forced its way partly inside. Frodo has been struck by an Orc-chieftain. The Company survives the fight, but remaining in the chamber means allowing the enemy to gather again.
So when the Fellowship escapes through the eastern doorway and begins descending toward the lower levels of Moria, Gandalf does something that can look strangely passive.
He does not stand in the corridor with Glamdring and wait for the pursuit.
He remains behind briefly and attempts to seal the door with a shutting-spell.
The distinction matters. Gandalf's purpose at this moment is not to defeat the enemy. It is to put distance, stone, and time between the Fellowship and whatever is following them.
And the terrifying part is that the strategy almost works—until something on the other side answers his power with power of its own.

The Fellowship Cannot Afford Another Battle
The fight in the Chamber of Mazarbul is not a victory in the strategic sense.
The Fellowship kills attackers and drives the first assault back, but they are trapped deep beneath the mountains, uncertain of the road, and surrounded by enemies whose total numbers they cannot know. Their real objective is escape.
That makes the eastern doorway valuable for a reason very different from an ordinary defensive position.
A warrior holding the doorway would still be physically attached to the battle. Every additional Orc would require another stroke, another moment, another risk. If enough enemies came, the defender could eventually be overwhelmed or cut off from the others.
A closed and magically resisted door offers something better: delay without requiring Gandalf to remain in direct combat.
This is especially important because Gandalf is their guide.
He has been leading the Company through Moria's immense and confusing passages. Losing him in an unnecessary rearguard action would endanger everyone even if the others escaped the immediate attack.
The Fellowship therefore does not need Gandalf to win the corridor.
It needs him to make the corridor useless to the enemy for as long as possible.
Gandalf Explicitly Explains the Problem
After the magical confrontation, Gimli asks Gandalf what happened at the door.
Gandalf's answer is unusually revealing about how this kind of magic works.
He says that he attempted a shutting-spell and that he knows many such spells. But he immediately adds two limitations: doing such things properly takes time, and even a magically shut door can still be broken by physical strength.
That detail prevents us from imagining the spell as an absolute magical barrier.
Gandalf is not creating an indestructible wall.
He is reinforcing control over an existing obstacle.
That obstacle is useful precisely because the architecture of Moria is doing much of the work. Instead of confronting every pursuer individually, Gandalf can make the doorway itself resist them.
The texts never give us a technical system explaining exactly how shutting-spells function, so it would be unsafe to assign precise rules to them. What the scene does establish is simpler: Gandalf can exert magical control over the door, but neither the spell nor the door is invulnerable.
The plan is therefore one of delay.
And against ordinary Orcs, delay may have been enough.

The Door Lets Gandalf Fight Without Fighting the Orcs
The enemy's numbers are the crucial tactical problem.
A narrow corridor can favor a defender, but it does not remove danger. The Chamber of Mazarbul has already shown that the Orcs possess more than ordinary infantry. A cave-troll participated in the assault, and the Orcs were capable of renewing their attack.
Gandalf also hears voices behind the door and believes they may break through at any moment.
A physical stand would force him to engage whatever arrived.
A shutting-spell changes the terms of the encounter.
The pursuers must first overcome the door.
That buys the rest of the Fellowship time to descend.
This resembles Gandalf's broader conduct throughout the journey: he repeatedly uses power according to necessity rather than simply unleashing everything available to him. In Moria especially, secrecy and movement matter. Earlier, after using fire against the wolves outside the mountains, Gandalf remarks that his actions have effectively announced his presence to those capable of recognizing the signs.
Magic can solve a problem while creating another.
At the eastern door of the Chamber, however, Gandalf has little choice. Pursuit is immediate. A spell that obstructs the passage is more useful than turning the stairway into another battlefield.
Then the situation changes completely.
Something Arrives That the Orcs Fear
Gandalf hears the Orcs speaking beyond the door. Among what he catches is the word ghâsh: "fire."
Then their behavior changes.
Something enters the chamber behind them.
The Orcs become silent and afraid.
At this point Gandalf does not yet identify the newcomer as a Balrog. That is important. Readers who already know what Durin's Bane is can easily project that knowledge backward into Gandalf's decisions.
But Gandalf himself later tells the Company that he did not know what he had encountered.
He felt the being through the door.
Then it took hold of the iron ring.
And then, in Gandalf's description, it perceived both him and his spell.
The confrontation suddenly stops being a question of whether Orcs can batter down a door.
Someone—or something—on the other side understands what Gandalf is doing.
And it answers.

The Counter-Spell Reveals the Real Danger
Gandalf describes the response as a terrible counter-spell.
For an instant, control of the door slips from him and it begins to open.
This is one of the most extraordinary magical confrontations in The Lord of the Rings because neither participant can initially see the other. There is no swordplay and no dramatic exchange of identities. The closed door itself becomes the point over which two powers struggle.
Gandalf does not yet know his opponent.
His opponent nevertheless perceives his spell.
We should be careful about turning this into a detailed theory of magical detection. The text does not explain exactly what either being learns about the other. Gandalf explicitly says he cannot guess what the challenger is.
What he does know is the scale of the resistance.
He says he has never felt such a challenge.
That is the warning.
The shutting-spell was intended to prevent pursuit. Instead, it has brought Gandalf into direct contest with an unknown power capable of opposing him magically.
The Word of Command Is an Emergency Escalation
When the door begins to open, Gandalf escalates.
He speaks what he calls a "word of Command."
The text does not define this as a formal category of magic with a known set of rules, and we should not pretend that it does. What matters is its effect and cost.
The strain is enormous.
The door bursts apart. Gandalf is thrown backward down the stairs. He believes the wall and roof of the chamber also collapse.
The result is almost paradoxical.
His attempt to keep the door shut ends by destroying the door entirely.
Yet strategically, the destruction succeeds.
The collapse blocks the passage behind the Fellowship.
Gandalf believes Balin's tomb is buried beneath the wreckage and wonders whether the mysterious enemy may also have been buried. He does not know.
What he does know is that the route behind them has been completely obstructed.
The magical duel has therefore accomplished the original objective—delay—but at far greater cost than Gandalf intended.
He emerges exhausted.
Why Not Simply Hold the Corridor?
Because holding the corridor solves the wrong problem.
Gandalf is not trying to defend territory. The Fellowship has no reason to keep the Chamber of Mazarbul or any other part of Moria. Their entire strategic purpose is to get through the eastern gate and escape.
A rearguard fighter remains tied to the enemy.
A sealed passage separates from the enemy.
That difference becomes even clearer when Gandalf finally does choose to make a physical stand.
He does so at the Bridge of Khazad-dûm.
There the geography is completely different.
The bridge is narrow, spanning a tremendous abyss, and the Fellowship must cross it to reach the exit. Gandalf can allow the others to pass and then confront the pursuing Balrog at a point where the enemy cannot simply surround him.
Most importantly, by then the nature of the threat has been revealed.
Legolas identifies the creature as a Balrog, and Gandalf recognizes what he faces.
The bridge is therefore not simply another version of the doorway.
At the door, Gandalf is buying time from unknown pursuers while preserving the Fellowship's movement.
At the bridge, he is deliberately denying passage to a known and terrible enemy.

The Door Scene Makes the Bridge More Frightening
The magical struggle outside the Chamber of Mazarbul is easy to overlook because the Balrog itself is still hidden.
But that is precisely why the scene matters.
Before anyone sees Durin's Bane, its power is demonstrated through Gandalf.
The Orcs fear it.
It perceives his spell.
It counters him.
Its challenge nearly breaks him.
And forcing the contest further leaves Gandalf so exhausted that he must stop briefly to recover.
By the time the Balrog finally appears openly, the reader has already been shown that ordinary measures cannot reliably contain it.
The shutting-spell was not a foolish alternative to heroic swordplay. It was arguably the more efficient defensive choice available: let the Fellowship flee, make the architecture resist the pursuers, and avoid wasting lives in another battle.
What Gandalf could not know was that the enemy approaching the door was not merely another company of Orcs.
Something ancient was coming through the Chamber of Mazarbul.
And before Gandalf ever saw its shadow and flame, he had already discovered the most dangerous fact about it.
It could answer him.
Sources & Notes
- The Encyclopedia of Arda, “Gandalf” — https://www.glyphweb.com/arda/g/gandalf.html
- The Encyclopedia of Arda, “Doors of Durin” — https://www.glyphweb.com/arda/d/doorsofdurin.html
- The Encyclopedia of Arda, “Balrogs” — https://www.glyphweb.com/arda/b/balrogs.html
Reference entries document the people, places, events, and objects directly discussed in this article.
