David comes to Nob, where the priest Ahimelech is, who comes out to meet him trembling and asks why he is alone. David lies: he says the king has charged him with a secret matter and that his men are waiting for him at a certain place. He asks for five loaves or whatever is there. Ahimelech answers that he has only consecrated bread, and that he can give it if the young men have kept themselves from women. David assures him that they have, and the priest gives him the bread of the Presence that had been removed from before the Lord.
On that day Doeg the Edomite, Saul's chief shepherd, is there, detained before the Lord. David asks Ahimelech whether he has a spear or sword at hand, because the king's business was urgent and he did not bring his weapons. The priest says that he has only the sword of Goliath the Philistine, whom David killed in the valley of Elah, wrapped in a cloth behind the ephod. David says there is none like it, and takes it.
David rises that day and flees from Saul to Achish, king of Gath. The servants of Achish say that this is David, the king of the land, of whom they sang that Saul had struck down his thousands and David his ten thousands. David takes these words to heart and is very afraid of Achish. So he changes his behavior before them, pretends to be insane, scratches marks on the doors and lets his spittle run down his beard. Achish tells his servants that he has enough madmen already and drives him from his house.