diff --git a/src/PIL/PpmImagePlugin.py b/src/PIL/PpmImagePlugin.py
--- a/src/PIL/PpmImagePlugin.py
+++ b/src/PIL/PpmImagePlugin.py
@@ -333,7 +333,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
         rawmode, head = "1;I", b"P4"
     elif im.mode == "L":
         rawmode, head = "L", b"P5"
-    elif im.mode == "I":
+    elif im.mode in ("I", "I;16"):
         rawmode, head = "I;16B", b"P5"
     elif im.mode in ("RGB", "RGBA"):
         rawmode, head = "RGB", b"P6"

diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py
--- a/Tests/test_file_ppm.py
+++ b/Tests/test_file_ppm.py
@@ -95,7 +95,9 @@ def test_16bit_pgm_write(tmp_path: Path) -> None:
     with Image.open("Tests/images/16_bit_binary.pgm") as im:
         filename = str(tmp_path / "temp.pgm")
         im.save(filename, "PPM")
+        assert_image_equal_tofile(im, filename)
 
+        im.convert("I;16").save(filename, "PPM")
         assert_image_equal_tofile(im, filename)
 
 

Save 16-bit PGM Image?
I am attempting to convert an image in PNG format to a 16-bit PGM format and save it using Python's [PIL](https://python-pillow.org/) library. I'm using Python 3.12.4 in all examples shown.

---

Using the following `test.png` image:

![test](https://github.com/python-pillow/Pillow/assets/95188575/96526c49-5b98-4c49-a7c3-f32135da8405)

Attempting a simple script like this with the [Image.save()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save) function:

```python
from PIL import Image

image = Image.open("test.png")
image.save("test.pgm")
```

Can save resave the image as PGM, however it's always saved as an 8-bit image, as shown by GIMP:

![gimp](https://github.com/python-pillow/Pillow/assets/95188575/6b09a48b-3dfc-4598-8a52-5f876081d892)

---

Attempting to specify the amount of pixel bits via the optional `bits` argument as such:

```python
from PIL import Image

image = Image.open("test.png")
image.save("test.pgm", bits = 16)
```

Also results in an 8-bit PGM image being saved.

---

Attempting to manually create a numpy array of the `np.uint16` type & then creating an image from it using the [Image.fromarray()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.fromarray) function as such:

```python
from PIL import Image
import numpy as np

image = Image.open("test.png")
imageData = np.array(image.getdata(), dtype = np.uint16)
newImage = Image.fromarray(imageData)
newImage.save("test.pgm", bits = 16)

```

Results in:

```
OSError: cannot write mode I;16 as PPM
```

I also noticed that this appears to break the image, as saving with `np.uint32` saves a blank image with a very narrow horizontal size and a very large vertical size.

---

What is the proper way to save 16-bit PGM images using the Python `PIL` library?

Thanks for reading my post, any guidance is appreciated.
