in the line of duty
As a part of or during the course of one's ordinary duties in a particular job or profession. Firefighters are constantly risking their lives in the line of duty. Soldiers have to mentally prepare themselves for what they will encounter in the line of duty.
in the line of duty
Fig. as part of one's expected duties. When soldiers fight people in a war, it's in the line of duty. Police officers have to do things they may not like in the line of duty.
in the ˌline of ˈduty
while doing a job: A police officer was injured in the line of duty yesterday.