Libya ordered the closure of its borders with four of its neighbors Sunday as it declared martial law in its vast desert south in the face of mounting unrest, state media reported.