Six-hour siege with man who tried to stab police officer