How do I programmatically place a block? From UI you can add a block in a region in that way:  


Go to Admin -> Structure -> Block layout (/admin/structure/block).  
Click on "Place block" button besides the region name.  


I want to do the same thing but programmatically. How do I add an existing block to a region and save it? This block should then be displayed in that region and be  available in the Block layout page.
To provide a plugin block you can build an array of settings and pass it off to \Drupal\block\Entity\Block::create() to create the Block object and save the instance.

For example if you wanted to add a Devel Execute PHP block to the Seven theme:

$values = array(
  // A unique ID for the block instance.
  'id' =&gt; 'devel_execute_php_1',
  // The plugin block id as defined in the class.
  'plugin' =&gt; 'devel_execute_php',
  // The machine name of the theme region.
  'region' =&gt; 'content',
  'settings' =&gt; array(
    'label' =&gt; 'Execute PHP',
  ),
  // The machine name of the theme.  
  'theme' =&gt; 'seven',
  'visibility' =&gt; array(),
  'weight' =&gt; 100,
);
$block = \Drupal\block\Entity\Block::create($values);
$block-&gt;save();