diff --git a/photutils/segmentation/deblend.py b/photutils/segmentation/deblend.py
index <HASH>..<HASH> 100644
--- a/photutils/segmentation/deblend.py
+++ b/photutils/segmentation/deblend.py
@@ -224,11 +224,8 @@ def _deblend_source(data, segment_img, npixels, nlevels=32, contrast=0.001,
         raise ValueError('Invalid connectivity={0}.  '
                          'Options are 4 or 8'.format(connectivity))
 
-    # Work on a copy of the data to avoid modifying the input image
-    data = data.copy()
     segm_mask = (segment_img.data > 0)
     source_values = data[segm_mask]
-    data[~segm_mask] = 0
     source_min = np.min(source_values)
     source_max = np.max(source_values)
     if source_min == source_max:
@@ -255,9 +252,10 @@ def _deblend_source(data, segment_img, npixels, nlevels=32, contrast=0.001,
 
     # create top-down tree of local peaks
     segm_tree = []
+    mask = ~segm_mask
     for level in thresholds[::-1]:
         segm_tmp = detect_sources(data, level, npixels=npixels,
-                                  connectivity=connectivity)
+                                  connectivity=connectivity, mask=mask)
         if segm_tmp.nlabels >= 2:
             fluxes = []
             for i in segm_tmp.labels:
Use the new mask keyword for detect_sources