Steganographic methods are desired to have the least impact on the statistical and perceptual properties of the cover image to prevent steganalytical methods from the detection of data hiding in the image. The existing spatial domain methods of steganography generally have low data-hiding capacity and low security. We present an adaptive spatial domain steganographic method with increased security and capacity. The method partitions the image into flat and nonflat blocks and uses different embedding strategies based on the block type. These strategies are based on modifying certain pixels within each block of the image. Experimental results show that the histogram and higher order statistics-based steganalytical methods cannot detect the stego images produced by the proposed method and that the capacity is increased significantly.