Based on the definitions I can find of murder in various dictionaries, it seems almost universally defined as an unlawful act. If you choose to go by the commonly-accepted usage of the term, it would not be a murder if the killing is found to be lawful. There are other words, such as homicide, that could be used here [1, 2]. The CPS themselves (in the UK) have a whole page about this distinction.
[1] https://www.cps.gov.uk/legal-guidance/homicide-murder-and-ma...
[2] https://murphylawoffice.org/john-murphy-law-office-blog/77-w...